C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Member function release of std::unique_ptr
From: Vladimir Grigoriev (vlad.moscow_at_[hidden])
Date: 2021-06-24 05:44:42


Oh< I am sorry, Ignore the message.
 
With best regards,
(Vlad from Moscow)
 
 
You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
 
 
>Четверг, 24 июня 2021, 13:44 +03:00 от Vladimir Grigoriev via Std-Discussion <std-discussion_at_[hidden]>:
> 
>And why are you using release instead of reset in your example?
> 
>With best regards,
>(Vlad from Moscow)
>You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
> 
> 
>>Четверг, 24 июня 2021, 1:11 +03:00 от Robert A.H. Leahy < rleahy_at_[hidden] >:
>> 
>>That would produce a false positive on this snippet:
>> 
>>std::vector<int*> v;
>>// Assume there is machinery here that deletes
>>// all pointers in v on scope exit
>>auto ptr = std::make_unique<int>(5);
>>v.push_back(ptr.get());
>>ptr.release();
>> 
>>Thanks,
>> 
>>--Robert
>> 
>> 
>>----------------------------------------------------------------------
>>From: Std-Discussion < std-discussion-bounces_at_[hidden] > on behalf of Vladimir Grigoriev via Std-Discussion < std-discussion_at_[hidden] >
>>Sent: Wednesday, June 23, 2021 18:08
>>To: std-discussion < std-discussion_at_[hidden] >
>>Cc: Vladimir Grigoriev < vlad.moscow_at_[hidden] >
>>Subject: [std-discussion] Member function release of std::unique_ptr
>> 
>>Why does not the member function release of the class template std::unique_ptr have the attribute nodiscard?
>> 
>>With best regards,
>>(Vlad from Moscow)
>> 
>>You can meet me at http://cpp.forum24.ru/ or www.stackoverflow.com or http://ru.stackoverflow.com
> 
>--
>Std-Discussion mailing list
>Std-Discussion_at_[hidden]
>https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion
 



STD-DISCUSSION list run by std-discussion-owner@lists.isocpp.org

Older Archives on Google Groups