
9 Oct
2008
9 Oct
'08
3:32 p.m.
dariomt@gmail.com wrote:
I see that operator== and operator!= are implemented comparing the pointer inside the shared_ptr's using get(), but operator< uses _internal_less, that does a different thing.
I thought that operator< would also be implemented using get(), so please, can you share the rationale behind the need for _internal_less?
get() returns px (the raw pointer), _internal_less compares pn (the shared_count). This is peculiar, since it means that alias pointers to different subobjects would compare non-equal, but sort equivalent. I'd like to know the rationale of this, too. Sebastian