<smart_ptr>
header<memory>
header has a mix of tools for
two widely different audiences:
<smart_ptr>
where all the smart pointers
live. For backward compatibility, <memory>
must
include <smart_ptr>
.
Regarding feature testing, checking for the presence of
the <smart_ptr>
header suffices.
<smart_ptr>
to table 16 in subclause 20.5.1.2 [headers].
Create a new first subclause [smart_ptr.syn] under 23.11 [smartptr]:
The header <smart_ptr>
defines several smart pointer
types and various function templates that operate on objects of these
types.
Move all declarations for entities described in [smartptr] from
[memory.syn] to [smart_ptr.syn]:
Change 23.10.2 [memory.syn] paragraph 1 as follows:// 23.11.1, class template unique_ptr template<class T> struct default_delete; template<class T> struct default_delete<T[]>; ... // 23.11.8, atomic smart pointers template<class T> struct atomic<shared_ptr<T>>; template<class T> struct atomic<weak_ptr<T>>;
The headerAdd a new subclause in Annex D [depr]:<memory>
defines several types and function templates that describe properties of pointers and pointer-like types, manage memory for containers and other template types, destroy objects, and construct multiple objects in uninitialized memory buffers (23.10.3-23.10.11).The header also defines the templates unique_ptr, shared_ptr, weak_ptr, and various function templates that operate on objects of these types (23.11).
D.x Deprecated location of smart pointers [depr.memory.smartptr]The header
<memory>
has the following addition:#include <smart_ptr>