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 32,010 of 33,346    |
|    Pete Becker to Michael    |
|    Re: why not implicit operator !=()?    |
|    15 Mar 12 13:51:29    |
   
   ba9807fd   
   From: pete@versatilecoding.com   
      
   On 2012-03-15 07:07:55 +0000, Michael said:   
      
   > This has probably been asked before but...   
   >   
   > Is there a particular reason why when you define an operator ==()   
   > for a type:   
   >   
   > struct SomeType   
   > {   
   > bool operator== (const SomeType& rhs) const { return ...; }   
   > };   
   >   
   > ... that the compiler doesn't also go ahead and implicitly define   
   > operator !=() for you?   
   >   
   > This omission has become a pet peeve of mine lately...   
   >   
      
   More generally, if you define operator== and operator<, the rest of the   
   comparison operators are defined in the namespace std::rel_ops, in the   
   header
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca