mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-18 10:06:54 +01:00
6723551a46
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@433 f6dd340e-d3f9-0310-b409-bdd246841980
20 lines
978 B
Text
20 lines
978 B
Text
The (now deprecated by the C++0x standard) smart pointer class
|
|
hi(auto_ptr)tt(std::auto_ptr<Type>) has traditionally been offered by
|
|
bf(C++). This class does not support emi(move semantics), but when an
|
|
tt(auto_ptr) object is assigned to another, the right-hand object loses its
|
|
information.
|
|
|
|
The class tt(unique_ptr) does not have tt(auto_ptr)'s drawbacks and
|
|
consequently using tt(auto_ptr) is now deprecated. tt(Auto_ptrs) suffer from
|
|
the following drawbacks:
|
|
itemization(
|
|
it() they do not support em(move semantics);
|
|
it() they should not be used to point to arrays;
|
|
it() they cannot be used as data types of abstract containers.
|
|
)
|
|
|
|
Because of its drawbacks and available replacements the tt(auto_ptr) class is
|
|
longer covered by the annotations(). Existing software should be modified to
|
|
use smart pointers (tt(unique_ptrs) or tt(shared_ptrs)) and new software
|
|
should, where applicable, directly be implemented in terms of these new
|
|
smart pointer types.
|