hi guys, just wondering if you have any shared_ptr tips for sorting vectors [code] std::vector< boost::shared_ptr<int> > v; //.. insert items into vector std::sort(v.begin(), v.end()); [/code] OK this doesn't sort by integer. I was hoping shared_ptrs < operator actually used the < operator of it's template type. however, i guess it's sorting by pointer value... the following works OK: [code] template <class T> struct X { bool operator()(const boost::shared_ptr<T>& a, const boost::shared_ptr<T>& b) { return *a < *b; } }; int main() { std::vector< boost::shared_ptr<int> > v; //.. insert items into vector std::sort(v.begin(), v.end(), X<int>()); return 0; } [/code] Does anyone have a better way of doing this? Maybe boost already defines a function similar to my X function. Maybe there is a way without using a predicate...