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 33,165 of 33,346   
   Greg Marr to All   
   Re: Does std::unique_ptr support self-re   
   11 Aug 13 00:10:39   
   
   From: gregmmarr@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'm curious if that is the behavior guaranteed by the standard.   
   > As I understand it, the standard seems to guarantee the opposite:   
   > it says get_deleter()(old_p) is called if old_p != nullptr, and   
   > in case of a self-reset of a non-null unique_ptr, old_p != nullptr   
   > holds and get_deleter()(old_p) should be called.   
      
   I don't know what the standard says, but I don't think that it's possible   
   to do otherwise than what VS is doing.  Otherwise, it would have to detect   
   that it just deleted what it is pointing to, and then null itself out again.   
      
      
   --   
         [ 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