23 Jul
2007
23 Jul
'07
1:49 p.m.
On 23/07/07, bringiton bringiton
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...
A shared_ptr is still a pointer, so the principle of least surprise means that it should sort like a pointer.
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...
This is one of my all-time favourite Boost.Lambda examples: std::sort( v.begin(), v.end(), *_1 < *_2 ); ~ Scott