Boost logo

Boost :

From: Loïc Joly (loic.actarus.joly_at_[hidden])
Date: 2005-09-14 16:05:02


Hello everybody,

Often , when someone creates a collection of smart_ptr, he wants the
collection to be sorted by objects, and not by pointer adresses (this is
what is used for instance in ptr_containers). To do that, one can
provide his functor to the container/algorithm required, but this is
burdensome.

I do not think that modifying the current behaviour of smart pointers to
make the comparison of smart pointers compare objet would be a good idea
(even in cases it is possible to compare by objects, people who do not
need this sorting would be impacted by the performances of sorting by
objects). However, since this a quite a common thing to do, I wonder
wether such a functor could be provided inside the smart_ptr headers, so
that people who want to use this option can use it directly.

What are your feelings about this idea ?

Best regards,

-- 
Loïc

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk