I have a std::list and in my class I have myclass::operator<(myclass &other) defined.
I use the std::list.sort
assuming you don't have NULL pointers in your list just do
bool ptrsorter( myclass *a, myclass *b ) {
return *a < *b;
}
mylist.sort( ptrsorter );
or if you're lucky enough to be using a more recent compiler (with C++0x-support), you can use a lambda-expression:
mylist.sort( []( myclass *a, myclass *b ) { return *a < *b } );