sorting with a custom comparison function

Hello,

Are there any sorting libraries which permit the user to define a custom comparison function in a similar way that one would do with qsort in C?

Yes, take a look a Thrust.