|
Boost : |
From: Braden N. McDaniel (braden_at_[hidden])
Date: 2000-02-27 06:30:41
On Sun, 27 Feb 2000, Kevlin Henney wrote:
> In message <Pine.LNX.4.10.10002261849370.12305-100000_at_boneone.endoframe.
> com>, Braden N. McDaniel <braden_at_[hidden]> writes
> >I'd like to put my vote in for including (at least) operator< on
> >shared_ptr. The context for this requirement for me is the need to use
> >shared_ptrs as keys in a sorted container.
>
> In which case, I'd like to put my vote in for not including (at most)
> operator< on shared_ptr ;-> Ordering relations between elements are
> already catered for in associative containers using the relevant
> function object class (eg std::less).
In order to use std::less (and the like), operator< needs to be defined.
shared_ptr appears to pursue the typical smart pointer aspiration of
remaining semantically and syntactically like dumb pointers (within the
constraints of the language and the constraints imposed by the value
added by the particular smart pointer, of course), and the existing
implementations of operator== and operator!= certainly support this. So
why not continue in this direction by adding operator< ?
-- Braden N. McDaniel braden_at_[hidden] <URL:http://www.endoframe.com>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk