.TH "std::experimental::optional< _Tp >" 3cxx "Sun Feb 7 2021" "libstdc++" \" -*- nroff -*- .ad l .nh .SH NAME std::experimental::optional< _Tp > \- Class template for optional values\&. .SH SYNOPSIS .br .PP .PP Inherits \fBstd::experimental::_Optional_base< _Tp, _ShouldProvideDestructor >\fP, and \fBstd::_Enable_copy_move< is_copy_constructible< _Tp >::value, __and_< is_copy_constructible< _Tp >, is_copy_assignable< _Tp > >::value, is_move_constructible< _Tp >::value, __and_< is_move_constructible< _Tp >, is_move_assignable< _Tp > >::value, 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, decay_t< _Up >>>, is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp > >::value, bool > = true> constexpr \fBoptional\fP (_Up &&__t)" .br .ti -1c .RI "template, decay_t< _Up >>>, is_constructible< _Tp, _Up && >, __not_< is_convertible< _Up &&, _Tp >> >::value, bool > = false> constexpr \fBoptional\fP (_Up &&__t)" .br .ti -1c .RI "template>, is_constructible< _Tp, const _Up & >, is_convertible< const _Up &, _Tp >, __not_< __converts_from_optional< _Tp, _Up >> >::value, bool > = true> constexpr \fBoptional\fP (const \fBoptional\fP< _Up > &__t)" .br .ti -1c .RI "template>, is_constructible< _Tp, const _Up & >, __not_< is_convertible< const _Up &, _Tp >>, __not_< __converts_from_optional< _Tp, _Up >> >::value, bool > = false> constexpr \fBoptional\fP (const \fBoptional\fP< _Up > &__t)" .br .ti -1c .RI "template>, is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp >, __not_< __converts_from_optional< _Tp, _Up >> >::value, bool > = true> constexpr \fBoptional\fP (\fBoptional\fP< _Up > &&__t)" .br .ti -1c .RI "template>, is_constructible< _Tp, _Up && >, __not_< is_convertible< _Up &&, _Tp >>, __not_< __converts_from_optional< _Tp, _Up >> >::value, bool > = false> constexpr \fBoptional\fP (\fBoptional\fP< _Up > &&__t)" .br .ti -1c .RI "template \fBenable_if_t\fP< \fBis_constructible\fP< _Tp, _Args &&\&.\&.\&. >::value > \fBemplace\fP (_Args &&\&.\&.\&. __args)" .br .ti -1c .RI "template \fBenable_if_t\fP< \fBis_constructible\fP< _Tp, \fBinitializer_list\fP< _Up > &, _Args &&\&.\&.\&. >::value > \fBemplace\fP (\fBinitializer_list\fP< _Up > __il, _Args &&\&.\&.\&. __args)" .br .ti -1c .RI "constexpr \fBoperator bool\fP () const noexcept" .br .ti -1c .RI "constexpr _Tp & \fBoperator*\fP () &" .br .ti -1c .RI "constexpr _Tp && \fBoperator*\fP () &&" .br .ti -1c .RI "constexpr const _Tp & \fBoperator*\fP () const &" .br .ti -1c .RI "constexpr const _Tp && \fBoperator*\fP () const &&" .br .ti -1c .RI "_Tp * \fBoperator\->\fP ()" .br .ti -1c .RI "constexpr const _Tp * \fBoperator\->\fP () const" .br .ti -1c .RI "template \fBenable_if_t\fP< __and_< __not_< \fBis_same\fP< \fBoptional\fP< _Tp >, \fBdecay_t\fP< _Up > > >, \fBis_constructible\fP< _Tp, _Up >, __not_< __and_< \fBis_scalar\fP< _Tp >, \fBis_same\fP< _Tp, \fBdecay_t\fP< _Up > > > >, \fBis_assignable\fP< _Tp &, _Up > >::value, \fBoptional\fP & > \fBoperator=\fP (_Up &&__u)" .br .ti -1c .RI "template \fBenable_if_t\fP< __and_< __not_< \fBis_same\fP< _Tp, _Up > >, \fBis_constructible\fP< _Tp, const _Up & >, \fBis_assignable\fP< _Tp &, _Up >, __not_< __converts_from_optional< _Tp, _Up > >, __not_< __assigns_from_optional< _Tp, _Up > > >::value, \fBoptional\fP & > \fBoperator=\fP (const \fBoptional\fP< _Up > &__u)" .br .ti -1c .RI "\fBoptional\fP & \fBoperator=\fP (\fBnullopt_t\fP) noexcept" .br .ti -1c .RI "template \fBenable_if_t\fP< __and_< __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 > > >::value, \fBoptional\fP & > \fBoperator=\fP (\fBoptional\fP< _Up > &&__u)" .br .ti -1c .RI "void \fBswap\fP (\fBoptional\fP &__other) noexcept(\fBis_nothrow_move_constructible\fP< _Tp >() &&__is_nothrow_swappable< _Tp >::value)" .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 _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::experimental::optional< _Tp >" Class template for optional values\&. .PP Definition at line 491 of file optional\&. .SH "Author" .PP Generated automatically by Doxygen for libstdc++ from the source code\&.