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 33,008 of 33,346    |
|    Daryle Walker to All    |
|    Method to get a noexcept-swap check?    |
|    30 Apr 13 12:48:42    |
   
   From: darylew@googlemail.com   
      
   { Please limit your text to fit within 80 columns, preferably around 70,   
    so that readers don't have to scroll horizontally to read each line.   
    This article has been reformatted manually by the moderator. -mod }   
      
   I've read about people wondering how to do:   
      
   MyClass   
   {   
   public:   
    //...   
    void swap( MyClass & ) noexcept( /*What goes here?*/ );   
    //...   
   };   
      
   The answer depends on the noexcept status of the internal component   
   types' swapping. You could put calls to "swap" in the expression and   
   hope that ADL is invoked. It would probably be complicated. Then I   
   thought about C-level arrays. C++11 adds a version of "std::swap" for   
   C-level arrays. Since that will have a noexcept setting based on the   
   extents-stripped type, we could use that to universally check for swap:   
      
    noexcept( std::swap(std::declval
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca