[C++ committee] auto_ptr removal in C++17 - request to comittie

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[C++ committee] auto_ptr removal in C++17 - request to comittie

Boost - Dev mailing list
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.

Artyom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [C++ committee] auto_ptr removal in C++17 - request to comittie

Boost - Dev mailing list
Am 07.08.2017 um 07:32 schrieb Artyom Beilis via Boost:
> Hello,
>
> If somebody on committee is on this list. I really want to do
> something to prevent auto_ptr removal.
Even if, wrong list. Go to the standard mailing lists. Also it's already
approved, so you're way too late.
> 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.
You can use boost::shared_ptr prior to C++11.

>
> 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.
It's not the hard:

#if __cplusplus <= 199711L
std::auto_ptr<foo> thiny;
#else
std::shared_ptr<foo> thingy;
#endif
>
> C++ committee please stop breaking existing code even if
> std::unique_ptr much better it does not exist in C++2003.
Then do not use C++17, simple as that. If you want full C++98
compatibility, use C++98.
>
> Artyom
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [C++ committee] auto_ptr removal in C++17 - request to comittie

Boost - Dev mailing list
In reply to this post by Boost - Dev mailing list
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

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...