Boost logo

Boost :

From: Beman Dawes (beman_at_[hidden])
Date: 2000-03-16 13:44:16


At 09:52 PM 3/15/00 -0700, Greg Colvin wrote:

>The compiler is looking for an operator<, which shared_ptr
>doesn't have. It does have a less functor, which you should
>be able to supply as a further template argument.

To try to make this clearer, I added the following to the docs (ditto
for shared_array). The first sentance was already there:

Class shared_ptr meets the CopyConstuctible and Assignable
requirements of the C++ Standard Library, and so can be used in C++
Standard Library containers. Note that the Standard Library's
default Compare template parameter (class Compare = less<Key>) will
not work for shared_ptr as it requires operator< which is not defined
for shared_ptr. The functor less< boost::shared_ptr<T> > is supplied
instead (compiler must support partial specialization).

--Beman


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