Then again, taking a deeper look on your snippet, you are sorting all kinds of types.

I remember seeing something similar in a thread here and found it at [1].

It works by creating an ascending sequence of types, and sorting them according to the distance (or rather the index) of the types. You may need to put some more types in there according to what you expect from your clients.

Your other option is providing the less<> types needed for sort<> to know the ordering relation between types.

Good luck,
Rodrigo

[1] http://lists.boost.org/boost-users/2008/03/34797.php