.TH "std::unique_ptr< _Tp, _Dp >" 3cxx "Wed Apr 11 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< \fBis_reference\fP< 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< 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_< is_convertible< typename \fBunique_ptr\fP< _Up, _Ep >::pointer, pointer >, __not_< \fBis_array\fP< _Up > > >::value, \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> .br 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< \fBis_reference\fP< 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 184 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 196 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 203 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 208 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 223 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 235 of file unique_ptr\&.h\&. .SH "Member Function Documentation" .PP .SS "template> pointer \fBstd::unique_ptr\fP< _Tp, _Dp >::get (void) const\fC [inline]\fP, \fC [noexcept]\fP" .PP Return the stored pointer\&. .PP Definition at line 307 of file unique_ptr\&.h\&. .PP Referenced by std::unique_ptr< _Tp[], _Dp >::swap()\&. .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 312 of file unique_ptr\&.h\&. .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 317 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 321 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 291 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 299 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 252 of file unique_ptr\&.h\&. .SS "template> template enable_if< __and_< is_convertible::pointer, pointer>, __not_<\fBis_array\fP<_Up> > >::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 272 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 281 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 328 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 342 of file unique_ptr\&.h\&. .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 352 of file unique_ptr\&.h\&. .PP Referenced by std::unique_ptr< _Tp[], _Dp >::swap()\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.