I've just been compiling some of my own code with the -std=c++0x
flag in GCC, as I want to vaguely keep up with what all the young folks are doing (provided they stay of my lawn), and I ended up with a load of warnings about auto_ptr
being deprecated. Of course, I knew that auto_ptr
was deprecated in C++0x, but...
Isn't deprecation a waste of time and effort? Reasons for not deprecating (with auto_ptr as an example):
there is an ocean of code out there that still needs to be supported, producing millions of warnings will only tempt people to turn warnings off.
auto_ptr
is a bit naff, but it does actually do what it says on the tin.if we really want to deprecate things, I nominate
printf()
. But just imagine the squeals that would ensue.auto_ptr
doesn't have too many friends, but in at least my C++ code it is used more thanprintf
, which isn't used at all.the committee have a bad record of getting this right - they deprecated static at namespace scope, and now it seems to have been undeprecated - I wouldn't be surprised if
auto_ptr
made a similar come-backlastly, whatever the committee say, the compiler implementers ignore them - they simply can't risk breaking their customers code, all they can do is issue irritating warnings.
So my question - do you consider deprecation (of anything, not just auto_ptrs, and not just in C++) a good idea, and if so, why?
auto_ptr
as an example.unique_ptr
and be happier.