Boost logo

Boost :

Subject: Re: [boost] [C++ committee] auto_ptr removal in C++17 - request to comittie
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2017-08-07 08:03:16


On 08/07/17 08:32, Artyom Beilis via Boost wrote:
> Hello,
>
> If somebody on committee is on this list. I really want to do
> something to prevent auto_ptr removal.
>
> It is exceptionally useful smart pointer in C++2003 and it is needed
> by the code that needs to be compatible for both 2003 and 2017.
>
> It is needed by libraries that aim to be compatible with C++2003.
> In the real world there is a huge codebase that uses C++2003 why to
> break something that works - especially since it works quite well. It
> isn't "gets" that can't be used securely.
>
> C++ committee please stop breaking existing code even if
> std::unique_ptr much better it does not exist in C++2003.

I think this is better placed on the std-discussion list[1], although I
doubt it will have effect.

If you want your code to be portable across different C++ versions I
would suggest using boost::unique_ptr[2] universally. If you just want
to delete objects when leaving scope, there is a more lightweight
alternative: boost::scoped_ptr and boost::scoped_array[3].

[1]:
https://groups.google.com/a/isocpp.org/forum/?fromgroups#!forum/std-discussion

[2]:
http://www.boost.org/doc/libs/1_64_0/doc/html/move/reference.html#header.boost.move.unique_ptr_hpp

[3]: http://www.boost.org/doc/libs/1_64_0/libs/smart_ptr/smart_ptr.htm


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk