.TH "std::optional< _Tp >" 3cxx "Wed Jul 28 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::optional< _Tp > \- Class template for optional values\&. .SH SYNOPSIS .br .PP .PP Inherits \fBstd::_Optional_base< _Tp, bool, bool >\fP, and \fBstd::_Enable_copy_move< is_copy_constructible_v< _Tp >, __and_v< is_copy_constructible< _Tp >, is_copy_assignable< _Tp > >, is_move_constructible_v< _Tp >, __and_v< is_move_constructible< _Tp >, is_move_assignable< _Tp > >, optional< _Tp > >\fP\&. .SS "Public Types" .in +1c .ti -1c .RI "using \fBvalue_type\fP = _Tp" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "template, __not_tag< _Up >, is_constructible< _Tp, _Up >, is_convertible< _Up, _Tp >> = true> constexpr \fBoptional\fP (_Up &&__t) noexcept(is_nothrow_constructible_v< _Tp, _Up >)" .br .ti -1c .RI "template, __not_tag< _Up >, is_constructible< _Tp, _Up >, __not_< is_convertible< _Up, _Tp >>> = false> constexpr \fBoptional\fP (_Up &&__t) noexcept(is_nothrow_constructible_v< _Tp, _Up >)" .br .ti -1c .RI "template>, is_constructible< _Tp, const _Up & >, is_convertible< const _Up &, _Tp >, __not_< __converts_from_optional< _Tp, _Up >>> = true> constexpr \fBoptional\fP (const \fBoptional\fP< _Up > &__t) noexcept(is_nothrow_constructible_v< _Tp, const _Up & >)" .br .ti -1c .RI "template>, is_constructible< _Tp, const _Up & >, __not_< is_convertible< const _Up &, _Tp >>, __not_< __converts_from_optional< _Tp, _Up >>> = false> constexpr \fBoptional\fP (const \fBoptional\fP< _Up > &__t) noexcept(is_nothrow_constructible_v< _Tp, const _Up & >)" .br .ti -1c .RI "template> = false> constexpr \fBoptional\fP (in_place_t, _Args &&\&.\&.\&. __args) noexcept(is_nothrow_constructible_v< _Tp, _Args\&.\&.\&. >)" .br .ti -1c .RI "template &, _Args\&.\&.\&. >> = false> constexpr \fBoptional\fP (in_place_t, \fBinitializer_list\fP< _Up > __il, _Args &&\&.\&.\&. __args) noexcept(is_nothrow_constructible_v< _Tp, \fBinitializer_list\fP< _Up > &, _Args\&.\&.\&. >)" .br .ti -1c .RI "constexpr \fBoptional\fP (\fBnullopt_t\fP) noexcept" .br .ti -1c .RI "template>, is_constructible< _Tp, _Up >, is_convertible< _Up, _Tp >, __not_< __converts_from_optional< _Tp, _Up >>> = true> constexpr \fBoptional\fP (\fBoptional\fP< _Up > &&__t) noexcept(is_nothrow_constructible_v< _Tp, _Up >)" .br .ti -1c .RI "template>, is_constructible< _Tp, _Up >, __not_< is_convertible< _Up, _Tp >>, __not_< __converts_from_optional< _Tp, _Up >>> = false> constexpr \fBoptional\fP (\fBoptional\fP< _Up > &&__t) noexcept(is_nothrow_constructible_v< _Tp, _Up >)" .br .ti -1c .RI "template \fBenable_if_t\fP< is_constructible_v< _Tp, _Args\&.\&.\&. >, _Tp & > \fBemplace\fP (_Args &&\&.\&.\&. __args) noexcept(is_nothrow_constructible_v< _Tp, _Args\&.\&.\&. >)" .br .ti -1c .RI "template \fBenable_if_t\fP< is_constructible_v< _Tp, \fBinitializer_list\fP< _Up > &, _Args\&.\&.\&. >, _Tp & > \fBemplace\fP (\fBinitializer_list\fP< _Up > __il, _Args &&\&.\&.\&. __args) noexcept(is_nothrow_constructible_v< _Tp, \fBinitializer_list\fP< _Up > &, _Args\&.\&.\&. >)" .br .ti -1c .RI "constexpr bool \fBhas_value\fP () const noexcept" .br .ti -1c .RI "constexpr \fBoperator bool\fP () const noexcept" .br .ti -1c .RI "constexpr _Tp && \fBoperator*\fP () &&noexcept" .br .ti -1c .RI "constexpr _Tp & \fBoperator*\fP () &noexcept" .br .ti -1c .RI "constexpr const _Tp && \fBoperator*\fP () const &&noexcept" .br .ti -1c .RI "constexpr const _Tp & \fBoperator*\fP () const &noexcept" .br .ti -1c .RI "constexpr const _Tp * \fBoperator\->\fP () const noexcept" .br .ti -1c .RI "constexpr _Tp * \fBoperator\->\fP () noexcept" .br .ti -1c .RI "template \fBenable_if_t\fP< __and_v< __not_self< _Up >, __not_< __and_< \fBis_scalar\fP< _Tp >, \fBis_same\fP< _Tp, \fBdecay_t\fP< _Up > > > >, \fBis_constructible\fP< _Tp, _Up >, \fBis_assignable\fP< _Tp &, _Up > >, \fBoptional\fP & > \fBoperator=\fP (_Up &&__u) noexcept(__and_v< \fBis_nothrow_constructible\fP< _Tp, _Up >, \fBis_nothrow_assignable\fP< _Tp &, _Up >>)" .br .ti -1c .RI "template \fBenable_if_t\fP< __and_v< __not_< \fBis_same\fP< _Tp, _Up > >, \fBis_constructible\fP< _Tp, const _Up & >, \fBis_assignable\fP< _Tp &, const _Up & >, __not_< __converts_from_optional< _Tp, _Up > >, __not_< __assigns_from_optional< _Tp, _Up > > >, \fBoptional\fP & > \fBoperator=\fP (const \fBoptional\fP< _Up > &__u) noexcept(__and_v< \fBis_nothrow_constructible\fP< _Tp, const _Up & >, \fBis_nothrow_assignable\fP< _Tp &, const _Up & >>)" .br .ti -1c .RI "\fBoptional\fP & \fBoperator=\fP (\fBnullopt_t\fP) noexcept" .br .ti -1c .RI "template \fBenable_if_t\fP< __and_v< __not_< \fBis_same\fP< _Tp, _Up > >, \fBis_constructible\fP< _Tp, _Up >, \fBis_assignable\fP< _Tp &, _Up >, __not_< __converts_from_optional< _Tp, _Up > >, __not_< __assigns_from_optional< _Tp, _Up > > >, \fBoptional\fP & > \fBoperator=\fP (\fBoptional\fP< _Up > &&__u) noexcept(__and_v< \fBis_nothrow_constructible\fP< _Tp, _Up >, \fBis_nothrow_assignable\fP< _Tp &, _Up >>)" .br .ti -1c .RI "void \fBreset\fP () noexcept" .br .ti -1c .RI "void \fBswap\fP (\fBoptional\fP &__other) noexcept(is_nothrow_move_constructible_v< _Tp > &&\fBis_nothrow_swappable_v\fP< _Tp >)" .br .ti -1c .RI "constexpr _Tp & \fBvalue\fP () &" .br .ti -1c .RI "constexpr _Tp && \fBvalue\fP () &&" .br .ti -1c .RI "constexpr const _Tp & \fBvalue\fP () const &" .br .ti -1c .RI "constexpr const _Tp && \fBvalue\fP () const &&" .br .ti -1c .RI "template constexpr _Tp \fBvalue_or\fP (_Up &&__u) &&" .br .ti -1c .RI "template constexpr _Tp \fBvalue_or\fP (_Up &&__u) const &" .br .in -1c .SH "Detailed Description" .PP .SS "template .br class std::optional< _Tp >" Class template for optional values\&. .PP Definition at line 663 of file optional\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.