.TH "std::unique_ptr< _Tp, _Dp >" 3cxx "Wed Jan 31 2018" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::unique_ptr< _Tp, _Dp > \- .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "typedef _Dp \fBdeleter_type\fP" .br .ti -1c .RI "typedef _Tp \fBelement_type\fP" .br .ti -1c .RI "typedef _Pointer::type \fBpointer\fP" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "constexpr \fBunique_ptr\fP () noexcept" .br .ti -1c .RI "\fBunique_ptr\fP (pointer __p) noexcept" .br .ti -1c .RI "\fBunique_ptr\fP (pointer __p, typename conditional< is_reference< deleter_type >::value, deleter_type, const deleter_type & >::type __d) noexcept" .br .ti -1c .RI "\fBunique_ptr\fP (pointer __p, typename remove_reference< deleter_type >::type &&__d) noexcept" .br .ti -1c .RI "constexpr \fBunique_ptr\fP (nullptr_t) noexcept" .br .ti -1c .RI "\fBunique_ptr\fP (\fBunique_ptr\fP &&__u) noexcept" .br .ti -1c .RI "template::pointer, pointer>, __not_>, typename conditional::value, is_same<_Ep, _Dp>, is_convertible<_Ep, _Dp>>::type>> \fBunique_ptr\fP (\fBunique_ptr\fP< _Up, _Ep > &&__u) noexcept" .br .ti -1c .RI "template \fBunique_ptr\fP (\fBauto_ptr\fP< _Up > &&__u) noexcept" .br .ti -1c .RI "\fBunique_ptr\fP (const \fBunique_ptr\fP &)=delete" .br .ti -1c .RI "\fB~unique_ptr\fP () noexcept" .br .ti -1c .RI "pointer \fBget\fP () const noexcept" .br .ti -1c .RI "deleter_type & \fBget_deleter\fP () noexcept" .br .ti -1c .RI "const deleter_type & \fBget_deleter\fP () const noexcept" .br .ti -1c .RI "\fBoperator bool\fP () const noexcept" .br .ti -1c .RI "add_lvalue_reference .br < element_type >::type \fBoperator*\fP () const " .br .ti -1c .RI "pointer \fBoperator->\fP () const noexcept" .br .ti -1c .RI "\fBunique_ptr\fP & \fBoperator=\fP (\fBunique_ptr\fP &&__u) noexcept" .br .ti -1c .RI "template enable_if< __and_ .br < is_convertible< typename .br \fBunique_ptr\fP< _Up, _Ep > .br ::pointer, pointer >, __not_ .br < is_array< _Up > > >::value, .br \fBunique_ptr\fP & >::type \fBoperator=\fP (\fBunique_ptr\fP< _Up, _Ep > &&__u) noexcept" .br .ti -1c .RI "\fBunique_ptr\fP & \fBoperator=\fP (nullptr_t) noexcept" .br .ti -1c .RI "\fBunique_ptr\fP & \fBoperator=\fP (const \fBunique_ptr\fP &)=delete" .br .ti -1c .RI "pointer \fBrelease\fP () noexcept" .br .ti -1c .RI "void \fBreset\fP (pointer __p=pointer()) noexcept" .br .ti -1c .RI "void \fBswap\fP (\fBunique_ptr\fP &__u) noexcept" .br .in -1c .SH "Detailed Description" .PP .SS "template>class std::unique_ptr< _Tp, _Dp >" 20\&.7\&.1\&.2 unique_ptr for single objects\&. .PP Definition at line 129 of file unique_ptr\&.h\&. .SH "Constructor & Destructor Documentation" .PP .SS "template> constexpr \fBstd::unique_ptr\fP< _Tp, _Dp >::\fBunique_ptr\fP ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Default constructor, creates a unique_ptr that owns nothing\&. .PP Definition at line 157 of file unique_ptr\&.h\&. .SS "template> \fBstd::unique_ptr\fP< _Tp, _Dp >::\fBunique_ptr\fP (pointer__p)\fC [inline]\fP, \fC [explicit]\fP, \fC [noexcept]\fP" Takes ownership of a pointer\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP A pointer to an object of \fCelement_type\fP .RE .PP The deleter will be value-initialized\&. .PP Definition at line 169 of file unique_ptr\&.h\&. .SS "template> \fBstd::unique_ptr\fP< _Tp, _Dp >::\fBunique_ptr\fP (pointer__p, typename conditional< is_reference< deleter_type >::value, deleter_type, const deleter_type & >::type__d)\fC [inline]\fP, \fC [noexcept]\fP" Takes ownership of a pointer\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP A pointer to an object of \fCelement_type\fP .br \fI__d\fP A reference to a deleter\&. .RE .PP The deleter will be initialized with \fC__d\fP .PP Definition at line 181 of file unique_ptr\&.h\&. .SS "template> \fBstd::unique_ptr\fP< _Tp, _Dp >::\fBunique_ptr\fP (pointer__p, typename remove_reference< deleter_type >::type &&__d)\fC [inline]\fP, \fC [noexcept]\fP" Takes ownership of a pointer\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP A pointer to an object of \fCelement_type\fP .br \fI__d\fP An rvalue reference to a deleter\&. .RE .PP The deleter will be initialized with \fCstd::move(__d)\fP .PP Definition at line 193 of file unique_ptr\&.h\&. .SS "template> constexpr \fBstd::unique_ptr\fP< _Tp, _Dp >::\fBunique_ptr\fP (nullptr_t)\fC [inline]\fP, \fC [noexcept]\fP" .PP Creates a unique_ptr that owns nothing\&. .PP Definition at line 200 of file unique_ptr\&.h\&. .SS "template> \fBstd::unique_ptr\fP< _Tp, _Dp >::\fBunique_ptr\fP (\fBunique_ptr\fP< _Tp, _Dp > &&__u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Move constructor\&. .PP Definition at line 205 of file unique_ptr\&.h\&. .SS "template> template::pointer, pointer>, __not_>, typename conditional::value, is_same<_Ep, _Dp>, is_convertible<_Ep, _Dp>>::type>> \fBstd::unique_ptr\fP< _Tp, _Dp >::\fBunique_ptr\fP (\fBunique_ptr\fP< _Up, _Ep > &&__u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Converting constructor from another type\&. Requires that the pointer owned by \fC__u\fP is convertible to the type of pointer owned by this object, \fC__u\fP does not own an array, and \fC__u\fP has a compatible deleter type\&. .PP Definition at line 220 of file unique_ptr\&.h\&. .SS "template> \fBstd::unique_ptr\fP< _Tp, _Dp >::~\fBunique_ptr\fP ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Destructor, invokes the deleter if the stored pointer is not null\&. .PP Definition at line 232 of file unique_ptr\&.h\&. .SH "Member Function Documentation" .PP .SS "template> pointer \fBstd::unique_ptr\fP< _Tp, _Dp >::get () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Return the stored pointer\&. .PP Definition at line 304 of file unique_ptr\&.h\&. .SS "template> deleter_type& \fBstd::unique_ptr\fP< _Tp, _Dp >::get_deleter ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Return a reference to the stored deleter\&. .PP Definition at line 309 of file unique_ptr\&.h\&. .PP Referenced by std::unique_ptr< std::vector< bool > >::operator=(), std::unique_ptr< _Tp[], _Dp >::operator=(), std::unique_ptr< std::vector< bool > >::reset(), std::unique_ptr< _Tp[], _Dp >::reset(), std::unique_ptr< std::vector< bool > >::~unique_ptr(), and std::unique_ptr< _Tp[], _Dp >::~unique_ptr()\&. .SS "template> const deleter_type& \fBstd::unique_ptr\fP< _Tp, _Dp >::get_deleter () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Return a reference to the stored deleter\&. .PP Definition at line 314 of file unique_ptr\&.h\&. .SS "template> \fBstd::unique_ptr\fP< _Tp, _Dp >::operator bool () const\fC [inline]\fP, \fC [explicit]\fP, \fC [noexcept]\fP" .PP Return \fCtrue\fP if the stored pointer is not null\&. .PP Definition at line 318 of file unique_ptr\&.h\&. .SS "template> add_lvalue_reference::type \fBstd::unique_ptr\fP< _Tp, _Dp >::operator* () const\fC [inline]\fP" .PP Dereference the stored pointer\&. .PP Definition at line 288 of file unique_ptr\&.h\&. .SS "template> pointer \fBstd::unique_ptr\fP< _Tp, _Dp >::operator-> () const\fC [inline]\fP, \fC [noexcept]\fP" .PP Return the stored pointer\&. .PP Definition at line 296 of file unique_ptr\&.h\&. .SS "template> \fBunique_ptr\fP& \fBstd::unique_ptr\fP< _Tp, _Dp >::operator= (\fBunique_ptr\fP< _Tp, _Dp > &&__u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Move assignment operator\&. .PP \fBParameters:\fP .RS 4 \fI__u\fP The object to transfer ownership from\&. .RE .PP Invokes the deleter first if this object owns a pointer\&. .PP Definition at line 249 of file unique_ptr\&.h\&. .SS "template> template enable_if< __and_< is_convertible::pointer, pointer>, __not_ > >::value, \fBunique_ptr\fP&>::type \fBstd::unique_ptr\fP< _Tp, _Dp >::operator= (\fBunique_ptr\fP< _Up, _Ep > &&__u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Assignment from another type\&. .PP \fBParameters:\fP .RS 4 \fI__u\fP The object to transfer ownership from, which owns a convertible pointer to a non-array object\&. .RE .PP Invokes the deleter first if this object owns a pointer\&. .PP Definition at line 269 of file unique_ptr\&.h\&. .SS "template> \fBunique_ptr\fP& \fBstd::unique_ptr\fP< _Tp, _Dp >::operator= (nullptr_t)\fC [inline]\fP, \fC [noexcept]\fP" .PP Reset the unique_ptr to empty, invoking the deleter if necessary\&. .PP Definition at line 278 of file unique_ptr\&.h\&. .SS "template> pointer \fBstd::unique_ptr\fP< _Tp, _Dp >::release ()\fC [inline]\fP, \fC [noexcept]\fP" .PP Release ownership of any stored pointer\&. .PP Definition at line 325 of file unique_ptr\&.h\&. .SS "template> void \fBstd::unique_ptr\fP< _Tp, _Dp >::reset (pointer__p = \fCpointer()\fP)\fC [inline]\fP, \fC [noexcept]\fP" .PP Replace the stored pointer\&. .PP \fBParameters:\fP .RS 4 \fI__p\fP The new pointer to store\&. .RE .PP The deleter will be invoked if a pointer is already owned\&. .PP Definition at line 339 of file unique_ptr\&.h\&. .PP Referenced by std::unique_ptr< std::vector< bool > >::operator=(), and std::unique_ptr< _Tp[], _Dp >::operator=()\&. .SS "template> void \fBstd::unique_ptr\fP< _Tp, _Dp >::swap (\fBunique_ptr\fP< _Tp, _Dp > &__u)\fC [inline]\fP, \fC [noexcept]\fP" .PP Exchange the pointer and deleter with another object\&. .PP Definition at line 349 of file unique_ptr\&.h\&. .PP Referenced by std::unique_ptr< std::vector< bool > >::reset(), std::unique_ptr< _Tp[], _Dp >::reset(), std::unique_ptr< std::vector< bool > >::swap(), and std::unique_ptr< _Tp[], _Dp >::swap()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.