C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Defect Report: shared_ptr::operator<() is not a strict weak

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards
View previous topic :: View next topic  
Author Message
Joe Gottman
Guest





PostPosted: Fri Nov 21, 2003 3:55 pm    Post subject: Defect Report: shared_ptr::operator<() is not a strict weak Reply with quote




[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
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ language, library and standards All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.