.TH "std::unique_ptr< _Tp, _Dp >" 3cxx "Sun Jan 10 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::unique_ptr< _Tp, _Dp > \- 20\&.7\&.1\&.2 unique_ptr for single objects\&. .SH SYNOPSIS .br .PP .SS "Public Types" .in +1c .ti -1c .RI "using \fBdeleter_type\fP = _Dp" .br .ti -1c .RI "using \fBelement_type\fP = _Tp" .br .ti -1c .RI "using \fBpointer\fP = typename __uniq_ptr_impl< _Tp, _Dp >::pointer" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "template> constexpr \fBunique_ptr\fP () noexcept" .br .RI "Default constructor, creates a unique_ptr that owns nothing\&. " .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 "template> constexpr \fBunique_ptr\fP (nullptr_t) noexcept" .br .RI "Creates a unique_ptr that owns nothing\&. " .ti -1c .RI "template> \fBunique_ptr\fP (pointer __p) noexcept" .br .ti -1c .RI "template>> \fBunique_ptr\fP (pointer __p, __enable_if_t::value, _Del && > __d) noexcept" .br .ti -1c .RI "template>> \fBunique_ptr\fP (pointer __p, const deleter_type &__d) noexcept" .br .ti -1c .RI "template::type> \fBunique_ptr\fP (pointer, __enable_if_t< \fBis_lvalue_reference\fP< _Del >::value, _DelUnref && >)=delete" .br .ti -1c .RI "\fBunique_ptr\fP (\fBunique_ptr\fP &&)=default" .br .RI "Move constructor\&. " .ti -1c .RI "template, typename conditional::value, is_same<_Ep, _Dp>, is_convertible<_Ep, _Dp>>::type>> \fBunique_ptr\fP (\fBunique_ptr\fP< _Up, _Ep > &&__u) noexcept" .br .RI "Converting constructor from another type\&. " .ti -1c .RI "\fB~unique_ptr\fP () noexcept" .br .RI "Destructor, invokes the deleter if the stored pointer is not null\&. " .ti -1c .RI "pointer \fBget\fP () const noexcept" .br .RI "Return the stored pointer\&. " .ti -1c .RI "const deleter_type & \fBget_deleter\fP () const noexcept" .br .RI "Return a reference to the stored deleter\&. " .ti -1c .RI "deleter_type & \fBget_deleter\fP () noexcept" .br .RI "Return a reference to the stored deleter\&. " .ti -1c .RI "\fBoperator bool\fP () const noexcept" .br .RI "Return \fCtrue\fP if the stored pointer is not null\&. " .ti -1c .RI "\fBadd_lvalue_reference\fP< element_type >::type \fBoperator*\fP () const" .br .RI "Dereference the stored pointer\&. " .ti -1c .RI "pointer \fBoperator\->\fP () const noexcept" .br .RI "Return the stored pointer\&. " .ti -1c .RI "\fBunique_ptr\fP & \fBoperator=\fP (const \fBunique_ptr\fP &)=delete" .br .ti -1c .RI "\fBunique_ptr\fP & \fBoperator=\fP (nullptr_t) noexcept" .br .RI "Reset the unique_ptr to empty, invoking the deleter if necessary\&. " .ti -1c .RI "\fBunique_ptr\fP & \fBoperator=\fP (\fBunique_ptr\fP &&)=default" .br .RI "Move assignment operator\&. " .ti -1c .RI "template \fBenable_if\fP< __and_< __safe_conversion_up< _Up, _Ep >, \fBis_assignable\fP< deleter_type &, _Ep && > >::value, \fBunique_ptr\fP & >::type \fBoperator=\fP (\fBunique_ptr\fP< _Up, _Ep > &&__u) noexcept" .br .RI "Assignment from another type\&. " .ti -1c .RI "pointer \fBrelease\fP () noexcept" .br .RI "Release ownership of any stored pointer\&. " .ti -1c .RI "void \fBreset\fP (pointer __p=pointer()) noexcept" .br .RI "Replace the stored pointer\&. " .ti -1c .RI "void \fBswap\fP (\fBunique_ptr\fP &__u) noexcept" .br .RI "Exchange the pointer and deleter with another object\&. " .in -1c .SS "Related Functions" (Note that these are not member functions\&.) .PP .RI "\fB\fP" .br .in +1c .in +1c .ti -1c .RI "template \fBenable_if\fP< __is_swappable< _Dp >::value >::type \fBswap\fP (\fBunique_ptr\fP< _Tp, _Dp > &__x, \fBunique_ptr\fP< _Tp, _Dp > &__y) noexcept" .br .ti -1c .RI "template bool \fBoperator==\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, const \fBunique_ptr\fP< _Up, _Ep > &__y)" .br .RI "Equality operator for unique_ptr objects, compares the owned pointers\&. " .ti -1c .RI "template bool \fBoperator==\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, nullptr_t) noexcept" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator==\fP (nullptr_t, const \fBunique_ptr\fP< _Tp, _Dp > &__x) noexcept" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator!=\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, const \fBunique_ptr\fP< _Up, _Ep > &__y)" .br .RI "Inequality operator for unique_ptr objects, compares the owned pointers\&. " .ti -1c .RI "template bool \fBoperator!=\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, nullptr_t) noexcept" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator!=\fP (nullptr_t, const \fBunique_ptr\fP< _Tp, _Dp > &__x) noexcept" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator<\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, const \fBunique_ptr\fP< _Up, _Ep > &__y)" .br .RI "Relational operator for unique_ptr objects, compares the owned pointers\&. " .ti -1c .RI "template bool \fBoperator<\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, nullptr_t)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator<\fP (nullptr_t, const \fBunique_ptr\fP< _Tp, _Dp > &__x)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator<=\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, const \fBunique_ptr\fP< _Up, _Ep > &__y)" .br .RI "Relational operator for unique_ptr objects, compares the owned pointers\&. " .ti -1c .RI "template bool \fBoperator<=\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, nullptr_t)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator<=\fP (nullptr_t, const \fBunique_ptr\fP< _Tp, _Dp > &__x)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator>\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, const \fBunique_ptr\fP< _Up, _Ep > &__y)" .br .RI "Relational operator for unique_ptr objects, compares the owned pointers\&. " .ti -1c .RI "template bool \fBoperator>\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, nullptr_t)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator>\fP (nullptr_t, const \fBunique_ptr\fP< _Tp, _Dp > &__x)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator>=\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, const \fBunique_ptr\fP< _Up, _Ep > &__y)" .br .RI "Relational operator for unique_ptr objects, compares the owned pointers\&. " .ti -1c .RI "template bool \fBoperator>=\fP (const \fBunique_ptr\fP< _Tp, _Dp > &__x, nullptr_t)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template bool \fBoperator>=\fP (nullptr_t, const \fBunique_ptr\fP< _Tp, _Dp > &__x)" .br .RI "unique_ptr comparison with nullptr " .ti -1c .RI "template _MakeUniq< _Tp >::__single_object \fBmake_unique\fP (_Args &&\&.\&.\&. __args)" .br .RI "std::make_unique for single objects " .ti -1c .RI "template _MakeUniq< _Tp >::__array \fBmake_unique\fP (size_t __num)" .br .RI "std::make_unique for arrays of unknown bound " .ti -1c .RI "template _MakeUniq< _Tp >::__invalid_type \fBmake_unique\fP (_Args &&\&.\&.\&.)=delete" .br .RI "Disable std::make_unique for arrays of known bound\&. " .in -1c .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 242 of file unique_ptr\&.h\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.