home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,728 of 33,346   
   Nevin ":-]" Liber to daniel.kruegler@googlemail.com   
   Re: Specializing std::less without an op   
   09 Dec 11 09:24:59   
   
   From: nevin@eviloverlord.com   
      
   In article ,   
    Daniel Krügler  wrote:   
      
   > This is true, but not much of a problem, because std::shared_ptr (as   
   > std::unique_ptr) implement operator < in terms of less<> of the underlying   
   > pointer:   
      
   > And the less<> specialization for pointers *does* induce a total order (see   
   > 20.8.5 p8).   
      
   But less<> of the underlying pointer implements an *unspecified* strict   
   weak ordering, which is just another way of saying that the actual order   
   itself is meaningless.   
      
   > boost::shared_ptr at least realizes a strict weak ordering, which also is   
   > useful in general.   
      
   Which is basically the same question that the OP asked about his own   
   type.  He wants to give his type a strict weak ordering, and I   
   recommended he do it via operator<.   
      
   --   
   Nevin ":-)" Liber     
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca