 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Joe Gottman Guest
|
Posted: Fri Nov 21, 2003 3:55 pm Post subject: Defect Report: shared_ptr::operator<() is not a strict weak |
|
|
[Note: Forwarded to C++ Committee. -sdc ]
According to the draft Technical Report on Standard Library Extensions,
two shared_ptr's are equivalent under the !(a < b) && !(b < a) relationship
if and only if they share ownership. But an empty (default constructed)
shared_ptr does not share ownership with anything, not even itself. This
means that if a is an empty shared_ptr, it will not be equivalent to itself,
so operator< is not a strict weak ordering. The same holds true for
weak_ptr's.
Suggested Resolution:
Change the specification of shared_ptr::operator<() to say two
shared_ptr's are equivalent if and only if they share ownership or are both
empty.
Change the specification of weak_ptr::operator<() to say two weak_ptr's
are equivalent if and only if they share ownership or are both empty.
Joe Gottman
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|