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,758 of 33,346   
   =?UTF-8?B?RGFuaWVsIEtyw7xnbGVy?= to All   
   Re: Are reference types CopyAssignable   
   21 Dec 11 03:09:58   
   
   From: daniel.kruegler@googlemail.com   
      
   Am 20.12.2011 22:33, schrieb Daniel Krügler:   
      
   > A final comment: The current preconditions of the expression-based   
   > traits are defective (The next LWG issue list will contain a   
   > corresponding new one): They allow too many situations which should   
   > actually lead to an ill-formed instantiation or to undefined behaviour,   
   > depending on the subtlety of the concrete case. One example is an   
   > assignment test of the following form:   
   >   
   > #include    
   >   
   > struct U;   
   >   
   > static_assert(!std::is_copy_assignable::value, "Error"); // ??   
   >   
   > struct U {};   
   >   
   > static_assert(std::is_copy_assignable::value, "Error");   
   >   
   > Now assume that the second test would happen in another translation   
   > unit: We would end up in a silent ODR violation.   
      
   In the above example I forgot to replace   
   std::is_copy_assignable by std::is_copy_assignable instead. As of   
   the current wording above examples violates the preconditions of the   
   trait, but by using a reference type instead it wouldn't (which is not   
   OK, of-course).   
      
   Apologize for the confusion,   
      
   Daniel   
      
      
   --   
         [ 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