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,166 of 33,346    |
|    SG to All    |
|    Re: Does std::unique_ptr support self-re    |
|    12 Aug 13 07:23:38    |
   
   From: sgesemann@googlemail.invalid   
      
   Am 12.08.2013 09:18, schrieb Greg Marr:   
   > On Sunday, August 11, 2013 6:10:02 PM UTC-4, Daniel Krügler wrote:   
   >>> At least in VS2010 and 2012, unique_ptr::reset checks for setting   
   >>> the same pointer and ignores it.   
   >>   
   >> This is indeed a non-conforming C++11 implementation, because   
   >> those effects were intentionally changed as of   
   >   
   > I guess the libstdc++ implementation is non-conforming too.   
   >   
   > void   
   > reset(pointer __p = pointer()) noexcept   
   > {   
   > using std::swap;   
   > swap(std::get<0>(_M_t), __p);   
   > if (__p != pointer())   
   > get_deleter()(__p);   
   > }   
      
   Actually, this looks good to me. It does not support self-reset but it   
   does not have to according to the standard. What do you think is   
   non-conforming about it?   
      
      
   --   
    [ 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