libstdc++
Optional values
Collaboration diagram for Optional values:

Classes

struct  std::experimental::fundamentals_v1::_Has_addressof< _Tp >
 
class  std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >
 
class  std::experimental::fundamentals_v1::_Optional_base< _Tp, false >
 
class  std::experimental::fundamentals_v1::bad_optional_access
 
struct  std::experimental::fundamentals_v1::in_place_t
 
struct  std::experimental::fundamentals_v1::nullopt_t
 
class  std::experimental::fundamentals_v1::optional< _Tp >
 

Macros

#define __cpp_lib_experimental_optional
 

Typedefs

template<typename _Tp , typename _Up >
using std::experimental::__assigns_from_optional = __or_< is_assignable< _Tp &, const optional< _Up > & >, is_assignable< _Tp &, optional< _Up > & >, is_assignable< _Tp &, const optional< _Up > && >, is_assignable< _Tp &, optional< _Up > && > >
 
template<typename _Tp , typename _Up >
using std::experimental::__converts_from_optional = __or_< is_constructible< _Tp, const optional< _Up > & >, is_constructible< _Tp, optional< _Up > & >, is_constructible< _Tp, const optional< _Up > && >, is_constructible< _Tp, optional< _Up > && >, is_convertible< const optional< _Up > &, _Tp >, is_convertible< optional< _Up > &, _Tp >, is_convertible< const optional< _Up > &&, _Tp >, is_convertible< optional< _Up > &&, _Tp > >
 
using std::hash< experimental::optional< _Tp > >::argument_type = experimental::optional< _Tp >
 
using std::hash< experimental::optional< _Tp > >::result_type = size_t
 
using std::experimental::fundamentals_v1::optional< _Tp >::value_type = _Tp
 

Enumerations

enum class  _Construct { _Token }
 

Functions

 std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base (_Optional_base &&__other) noexcept(is_nothrow_move_constructible< _Tp >())
 
 std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base (_Optional_base &&__other) noexcept(is_nothrow_move_constructible< _Tp >())
 
 std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base (const _Optional_base &__other)
 
 std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base (const _Optional_base &__other)
 
template<typename... _Args>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base (in_place_t, _Args &&... __args)
 
template<typename... _Args>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base (in_place_t, _Args &&... __args)
 
template<typename _Up , typename... _Args, enable_if_t< is_constructible< _Tp, initializer_list< _Up > &, _Args &&... >::value, int > ...>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base (in_place_t, initializer_list< _Up > __il, _Args &&... __args)
 
template<typename _Up , typename... _Args, enable_if_t< is_constructible< _Tp, initializer_list< _Up > &, _Args &&... >::value, int > ...>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base (in_place_t, initializer_list< _Up > __il, _Args &&... __args)
 
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base (nullopt_t) noexcept
 
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base (nullopt_t) noexcept
 
 std::experimental::fundamentals_v1::bad_optional_access::bad_optional_access (const char *__arg)
 
constexpr std::experimental::fundamentals_v1::nullopt_t::nullopt_t (_Construct)
 
template<typename _Up = _Tp, enable_if_t< __and_< __not_< is_same< optional< _Tp >, decay_t< _Up > > >, is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp > >::value, bool > = true>
constexpr std::experimental::fundamentals_v1::optional< _Tp >::optional (_Up &&__t)
 
template<typename _Up , enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, const _Up & >, is_convertible< const _Up &, _Tp >, __not_< __converts_from_optional< _Tp, _Up > > >::value, bool > = true>
constexpr std::experimental::fundamentals_v1::optional< _Tp >::optional (const optional< _Up > &__t)
 
template<typename _Up , enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp >, __not_< __converts_from_optional< _Tp, _Up > > >::value, bool > = true>
constexpr std::experimental::fundamentals_v1::optional< _Tp >::optional (optional< _Up > &&__t)
 
template<typename _Tp >
constexpr enable_if_t<!_Has_addressof< _Tp >::value, _Tp * > std::experimental::__constexpr_addressof (_Tp &__t)
 
void std::experimental::__throw_bad_optional_access (const char *) __attribute__((__noreturn__))
 
template<typename... _Args>
void std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_construct (_Args &&... __args) noexcept(is_nothrow_constructible< _Stored_type, _Args... >())
 
template<typename... _Args>
void std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_construct (_Args &&... __args) noexcept(is_nothrow_constructible< _Stored_type, _Args... >())
 
void std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_destruct ()
 
void std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_destruct ()
 
constexpr const _Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_get () const noexcept
 
constexpr const _Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_get () const noexcept
 
constexpr _Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_get () noexcept
 
_Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_get () noexcept
 
constexpr bool std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_is_engaged () const noexcept
 
constexpr bool std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_is_engaged () const noexcept
 
void std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_reset ()
 
void std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_reset ()
 
template<typename... _Args>
enable_if_t< is_constructible< _Tp, _Args &&... >::value > std::experimental::fundamentals_v1::optional< _Tp >::emplace (_Args &&... __args)
 
template<typename _Up , typename... _Args>
enable_if_t< is_constructible< _Tp, initializer_list< _Up > &, _Args &&... >::value > std::experimental::fundamentals_v1::optional< _Tp >::emplace (initializer_list< _Up > __il, _Args &&... __args)
 
template<typename _Tp >
constexpr optional< decay_t< _Tp > > std::experimental::make_optional (_Tp &&__t)
 
constexpr std::experimental::fundamentals_v1::optional< _Tp >::operator bool () const noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator!= (const _Tp &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator!= (const optional< _Tp > &__lhs, _Tp const &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator!= (const optional< _Tp > &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator!= (const optional< _Tp > &__lhs, nullopt_t) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator!= (nullopt_t, const optional< _Tp > &__rhs) noexcept
 
size_t std::hash< experimental::optional< _Tp > >::operator() (const experimental::optional< _Tp > &__t) const noexcept(noexcept(hash< _Tp > {}(*__t)))
 
constexpr _Tp & std::experimental::fundamentals_v1::optional< _Tp >::operator* () &
 
constexpr _Tp && std::experimental::fundamentals_v1::optional< _Tp >::operator* () &&
 
constexpr const _Tp & std::experimental::fundamentals_v1::optional< _Tp >::operator* () const &
 
constexpr const _Tp && std::experimental::fundamentals_v1::optional< _Tp >::operator* () const &&
 
_Tp * std::experimental::fundamentals_v1::optional< _Tp >::operator-> ()
 
constexpr const _Tp * std::experimental::fundamentals_v1::optional< _Tp >::operator-> () const
 
template<typename _Tp >
constexpr bool std::experimental::operator< (const _Tp &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator< (const optional< _Tp > &, nullopt_t) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator< (const optional< _Tp > &__lhs, const _Tp &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator< (const optional< _Tp > &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator< (nullopt_t, const optional< _Tp > &__rhs) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator<= (const _Tp &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator<= (const optional< _Tp > &__lhs, const _Tp &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator<= (const optional< _Tp > &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator<= (const optional< _Tp > &__lhs, nullopt_t) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator<= (nullopt_t, const optional< _Tp > &) noexcept
 
_Optional_basestd::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::operator= (_Optional_base &&__other) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp > >())
 
_Optional_basestd::experimental::fundamentals_v1::_Optional_base< _Tp, false >::operator= (_Optional_base &&__other) noexcept(__and_< is_nothrow_move_constructible< _Tp >, is_nothrow_move_assignable< _Tp > >())
 
template<typename _Up = _Tp>
enable_if_t< __and_< __not_< is_same< optional< _Tp >, decay_t< _Up > > >, is_constructible< _Tp, _Up >, __not_< __and_< is_scalar< _Tp >, is_same< _Tp, decay_t< _Up > > > >, is_assignable< _Tp &, _Up > >::value, optional & > std::experimental::fundamentals_v1::optional< _Tp >::operator= (_Up &&__u)
 
_Optional_basestd::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::operator= (const _Optional_base &__other)
 
_Optional_basestd::experimental::fundamentals_v1::_Optional_base< _Tp, false >::operator= (const _Optional_base &__other)
 
template<typename _Up >
enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, const _Up & >, is_assignable< _Tp &, _Up >, __not_< __converts_from_optional< _Tp, _Up > >, __not_< __assigns_from_optional< _Tp, _Up > > >::value, optional & > std::experimental::fundamentals_v1::optional< _Tp >::operator= (const optional< _Up > &__u)
 
optionalstd::experimental::fundamentals_v1::optional< _Tp >::operator= (nullopt_t) noexcept
 
template<typename _Up >
enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, _Up >, is_assignable< _Tp &, _Up >, __not_< __converts_from_optional< _Tp, _Up > >, __not_< __assigns_from_optional< _Tp, _Up > > >::value, optional & > std::experimental::fundamentals_v1::optional< _Tp >::operator= (optional< _Up > &&__u)
 
template<typename _Tp >
constexpr bool std::experimental::operator== (const _Tp &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator== (const optional< _Tp > &__lhs, const _Tp &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator== (const optional< _Tp > &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator== (const optional< _Tp > &__lhs, nullopt_t) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator== (nullopt_t, const optional< _Tp > &__rhs) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator> (const _Tp &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator> (const optional< _Tp > &__lhs, const _Tp &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator> (const optional< _Tp > &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator> (const optional< _Tp > &__lhs, nullopt_t) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator> (nullopt_t, const optional< _Tp > &) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator>= (const _Tp &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator>= (const optional< _Tp > &, nullopt_t) noexcept
 
template<typename _Tp >
constexpr bool std::experimental::operator>= (const optional< _Tp > &__lhs, const _Tp &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator>= (const optional< _Tp > &__lhs, const optional< _Tp > &__rhs)
 
template<typename _Tp >
constexpr bool std::experimental::operator>= (nullopt_t, const optional< _Tp > &__rhs) noexcept
 
void std::experimental::fundamentals_v1::optional< _Tp >::swap (optional &__other) noexcept(is_nothrow_move_constructible< _Tp >() &&__is_nothrow_swappable< _Tp >::value)
 
template<typename _Tp >
void std::experimental::swap (optional< _Tp > &__lhs, optional< _Tp > &__rhs) noexcept(noexcept(__lhs.swap(__rhs)))
 
constexpr _Tp & std::experimental::fundamentals_v1::optional< _Tp >::value () &
 
constexpr _Tp && std::experimental::fundamentals_v1::optional< _Tp >::value () &&
 
constexpr const _Tp & std::experimental::fundamentals_v1::optional< _Tp >::value () const &
 
constexpr const _Tp && std::experimental::fundamentals_v1::optional< _Tp >::value () const &&
 
template<typename _Up >
_Tp std::experimental::fundamentals_v1::optional< _Tp >::value_or (_Up &&__u) &&
 
template<typename _Up >
constexpr _Tp std::experimental::fundamentals_v1::optional< _Tp >::value_or (_Up &&__u) const &
 

Variables

_Empty_byte   std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_empty 
 
_Empty_byte   std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_empty 
 
_Stored_type   std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_payload 
 
_Stored_type   std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_payload 
 
constexpr in_place_t std::experimental::in_place
 
constexpr nullopt_t std::experimental::nullopt
 

Detailed Description

Class template for optional values and surrounding facilities, as described in n3793 "A proposal to add a utility class to represent optional objects (Revision 5)".

Macro Definition Documentation

◆ __cpp_lib_experimental_optional

#define __cpp_lib_experimental_optional

Definition at line 77 of file optional.

Typedef Documentation

◆ __assigns_from_optional

◆ __converts_from_optional

template<typename _Tp , typename _Up >
using std::experimental::fundamentals_v1::__converts_from_optional = typedef __or_<is_constructible<_Tp, const optional<_Up>&>, is_constructible<_Tp, optional<_Up>&>, is_constructible<_Tp, const optional<_Up>&&>, is_constructible<_Tp, optional<_Up>&&>, is_convertible<const optional<_Up>&, _Tp>, is_convertible<optional<_Up>&, _Tp>, is_convertible<const optional<_Up>&&, _Tp>, is_convertible<optional<_Up>&&, _Tp> >

Definition at line 472 of file optional.

◆ argument_type

template<typename _Tp >
using std::hash< experimental::optional< _Tp > >::argument_type = experimental::optional<_Tp>

Definition at line 992 of file optional.

◆ result_type

template<typename _Tp >
using std::hash< experimental::optional< _Tp > >::result_type = size_t

Definition at line 991 of file optional.

◆ value_type

template<typename _Tp >
using std::experimental::fundamentals_v1::optional< _Tp >::value_type = _Tp

Definition at line 516 of file optional.

Enumeration Type Documentation

◆ _Construct

enum class std::experimental::fundamentals_v1::nullopt_t::_Construct
strong

Definition at line 101 of file optional.

Function Documentation

◆ _Optional_base() [1/12]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base ( )
inlineconstexprnoexcept

Definition at line 216 of file optional.

◆ _Optional_base() [2/12]

template<typename _Tp >
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base ( )
inlineconstexprnoexcept

Definition at line 353 of file optional.

◆ _Optional_base() [3/12]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base ( _Optional_base< _Tp, _ShouldProvideDestructor > &&  __other)
inlinenoexcept

Definition at line 245 of file optional.

◆ _Optional_base() [4/12]

template<typename _Tp >
std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base ( _Optional_base< _Tp, false > &&  __other)
inlinenoexcept

Definition at line 380 of file optional.

◆ _Optional_base() [5/12]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base ( const _Optional_base< _Tp, _ShouldProvideDestructor > &  __other)
inline

Definition at line 239 of file optional.

◆ _Optional_base() [6/12]

template<typename _Tp >
std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base ( const _Optional_base< _Tp, false > &  __other)
inline

Definition at line 374 of file optional.

◆ _Optional_base() [7/12]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
template<typename... _Args>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base ( in_place_t  ,
_Args &&...  __args 
)
inlineexplicitconstexpr

Definition at line 224 of file optional.

◆ _Optional_base() [8/12]

template<typename _Tp >
template<typename... _Args>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base ( in_place_t  ,
_Args &&...  __args 
)
inlineexplicitconstexpr

Definition at line 360 of file optional.

◆ _Optional_base() [9/12]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
template<typename _Up , typename... _Args, enable_if_t< is_constructible< _Tp, initializer_list< _Up > &, _Args &&... >::value, int > ...>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base ( in_place_t  ,
initializer_list< _Up __il,
_Args &&...  __args 
)
inlineexplicitconstexpr

Definition at line 232 of file optional.

◆ _Optional_base() [10/12]

template<typename _Tp >
template<typename _Up , typename... _Args, enable_if_t< is_constructible< _Tp, initializer_list< _Up > &, _Args &&... >::value, int > ...>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base ( in_place_t  ,
initializer_list< _Up __il,
_Args &&...  __args 
)
inlineexplicitconstexpr

Definition at line 368 of file optional.

◆ _Optional_base() [11/12]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_Optional_base ( nullopt_t  )
inlineconstexprnoexcept

Definition at line 219 of file optional.

◆ _Optional_base() [12/12]

template<typename _Tp >
constexpr std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_Optional_base ( nullopt_t  )
inlineconstexprnoexcept

Definition at line 356 of file optional.

◆ bad_optional_access() [1/2]

std::experimental::fundamentals_v1::bad_optional_access::bad_optional_access ( )
inline

Definition at line 120 of file optional.

◆ bad_optional_access() [2/2]

std::experimental::fundamentals_v1::bad_optional_access::bad_optional_access ( const char *  __arg)
inlineexplicit

Definition at line 123 of file optional.

◆ nullopt_t()

constexpr std::experimental::fundamentals_v1::nullopt_t::nullopt_t ( _Construct  )
inlineexplicitconstexpr

Definition at line 104 of file optional.

◆ optional() [1/3]

template<typename _Tp >
template<typename _Up = _Tp, enable_if_t< __and_< __not_< is_same< optional< _Tp >, decay_t< _Up > > >, is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp > >::value, bool > = true>
constexpr std::experimental::fundamentals_v1::optional< _Tp >::optional ( _Up &&  __t)
inlineconstexpr

Definition at line 529 of file optional.

◆ optional() [2/3]

template<typename _Tp >
template<typename _Up , enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, const _Up & >, is_convertible< const _Up &, _Tp >, __not_< __converts_from_optional< _Tp, _Up > > >::value, bool > = true>
constexpr std::experimental::fundamentals_v1::optional< _Tp >::optional ( const optional< _Up > &  __t)
inlineconstexpr

Definition at line 548 of file optional.

◆ optional() [3/3]

template<typename _Tp >
template<typename _Up , enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, _Up && >, is_convertible< _Up &&, _Tp >, __not_< __converts_from_optional< _Tp, _Up > > >::value, bool > = true>
constexpr std::experimental::fundamentals_v1::optional< _Tp >::optional ( optional< _Up > &&  __t)
inlineconstexpr

Definition at line 574 of file optional.

◆ ~_Optional_base()

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::~_Optional_base ( )
inline

Definition at line 287 of file optional.

◆ __constexpr_addressof()

template<typename _Tp >
constexpr enable_if_t<!_Has_addressof< _Tp >::value, _Tp * > std::experimental::fundamentals_v1::__constexpr_addressof ( _Tp &  __t)
constexpr

An overload that attempts to take the address of an lvalue as a constant expression. Falls back to __addressof in the presence of an overloaded addressof operator (unary operator&), in which case the call will not be a constant expression.

Definition at line 177 of file optional.

◆ __throw_bad_optional_access()

void std::experimental::fundamentals_v1::__throw_bad_optional_access ( const char *  __s)
inline

Definition at line 134 of file optional.

◆ _M_construct() [1/2]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
template<typename... _Args>
void std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_construct ( _Args &&...  __args)
inlineprotectednoexcept

Definition at line 312 of file optional.

◆ _M_construct() [2/2]

template<typename _Tp >
template<typename... _Args>
void std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_construct ( _Args &&...  __args)
inlineprotectednoexcept

Definition at line 436 of file optional.

◆ _M_destruct() [1/2]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
void std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_destruct ( )
inlineprotected

Definition at line 321 of file optional.

◆ _M_destruct() [2/2]

template<typename _Tp >
void std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_destruct ( )
inlineprotected

Definition at line 445 of file optional.

◆ _M_get() [1/4]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
constexpr const _Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_get ( ) const
inlineconstexprprotectednoexcept

Definition at line 305 of file optional.

◆ _M_get() [2/4]

template<typename _Tp >
constexpr const _Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_get ( ) const
inlineconstexprprotectednoexcept

Definition at line 431 of file optional.

◆ _M_get() [3/4]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
constexpr _Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_get ( )
inlineconstexprprotectednoexcept

Definition at line 301 of file optional.

◆ _M_get() [4/4]

template<typename _Tp >
_Tp & std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_get ( )
inlineprotectednoexcept

Definition at line 427 of file optional.

◆ _M_is_engaged() [1/2]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
constexpr bool std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_is_engaged ( ) const
inlineconstexprprotectednoexcept

Definition at line 296 of file optional.

◆ _M_is_engaged() [2/2]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_is_engaged ( ) const
inlineconstexprprotectednoexcept

Definition at line 423 of file optional.

◆ _M_reset() [1/2]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
void std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_reset ( )
inlineprotected

Definition at line 329 of file optional.

◆ _M_reset() [2/2]

template<typename _Tp >
void std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_reset ( )
inlineprotected

Definition at line 452 of file optional.

◆ emplace() [1/2]

template<typename _Tp >
template<typename... _Args>
enable_if_t< is_constructible< _Tp, _Args &&... >::value > std::experimental::fundamentals_v1::optional< _Tp >::emplace ( _Args &&...  __args)
inline

Definition at line 672 of file optional.

◆ emplace() [2/2]

template<typename _Tp >
template<typename _Up , typename... _Args>
enable_if_t< is_constructible< _Tp, initializer_list< _Up > &, _Args &&... >::value > std::experimental::fundamentals_v1::optional< _Tp >::emplace ( initializer_list< _Up __il,
_Args &&...  __args 
)
inline

Definition at line 681 of file optional.

◆ make_optional()

template<typename _Tp >
constexpr optional< decay_t< _Tp > > std::experimental::fundamentals_v1::make_optional ( _Tp &&  __t)
constexpr

Definition at line 979 of file optional.

◆ operator bool()

template<typename _Tp >
constexpr std::experimental::fundamentals_v1::optional< _Tp >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Definition at line 742 of file optional.

◆ operator!=() [1/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator!= ( const _Tp &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 927 of file optional.

◆ operator!=() [2/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator!= ( const optional< _Tp > &  __lhs,
_Tp const __rhs 
)
constexpr

Definition at line 922 of file optional.

◆ operator!=() [3/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator!= ( const optional< _Tp > &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 823 of file optional.

◆ operator!=() [4/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator!= ( const optional< _Tp > &  __lhs,
nullopt_t   
)
constexprnoexcept

Definition at line 861 of file optional.

◆ operator!=() [5/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator!= ( nullopt_t  ,
const optional< _Tp > &  __rhs 
)
constexprnoexcept

Definition at line 866 of file optional.

◆ operator()()

template<typename _Tp >
size_t std::hash< experimental::optional< _Tp > >::operator() ( const experimental::optional< _Tp > &  __t) const
inlinenoexcept

Definition at line 995 of file optional.

◆ operator*() [1/4]

template<typename _Tp >
constexpr _Tp & std::experimental::fundamentals_v1::optional< _Tp >::operator* ( ) &
inlineconstexpr

Definition at line 731 of file optional.

◆ operator*() [2/4]

template<typename _Tp >
constexpr _Tp && std::experimental::fundamentals_v1::optional< _Tp >::operator* ( ) &&
inlineconstexpr

Definition at line 735 of file optional.

◆ operator*() [3/4]

template<typename _Tp >
constexpr const _Tp & std::experimental::fundamentals_v1::optional< _Tp >::operator* ( ) const &
inlineconstexpr

Definition at line 727 of file optional.

◆ operator*() [4/4]

template<typename _Tp >
constexpr const _Tp && std::experimental::fundamentals_v1::optional< _Tp >::operator* ( ) const &&
inlineconstexpr

Definition at line 739 of file optional.

◆ operator->() [1/2]

template<typename _Tp >
_Tp * std::experimental::fundamentals_v1::optional< _Tp >::operator-> ( )
inline

Definition at line 723 of file optional.

◆ operator->() [2/2]

template<typename _Tp >
constexpr const _Tp * std::experimental::fundamentals_v1::optional< _Tp >::operator-> ( ) const
inlineconstexpr

Definition at line 713 of file optional.

◆ operator<() [1/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator< ( const _Tp &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 936 of file optional.

◆ operator<() [2/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator< ( const optional< _Tp > &  ,
nullopt_t   
)
constexprnoexcept

Definition at line 870 of file optional.

◆ operator<() [3/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator< ( const optional< _Tp > &  __lhs,
const _Tp &  __rhs 
)
constexpr

Definition at line 931 of file optional.

◆ operator<() [4/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator< ( const optional< _Tp > &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 827 of file optional.

◆ operator<() [5/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator< ( nullopt_t  ,
const optional< _Tp > &  __rhs 
)
constexprnoexcept

Definition at line 875 of file optional.

◆ operator<=() [1/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator<= ( const _Tp &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 956 of file optional.

◆ operator<=() [2/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator<= ( const optional< _Tp > &  __lhs,
const _Tp &  __rhs 
)
constexpr

Definition at line 951 of file optional.

◆ operator<=() [3/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator<= ( const optional< _Tp > &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 839 of file optional.

◆ operator<=() [4/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator<= ( const optional< _Tp > &  __lhs,
nullopt_t   
)
constexprnoexcept

Definition at line 890 of file optional.

◆ operator<=() [5/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator<= ( nullopt_t  ,
const optional< _Tp > &   
)
constexprnoexcept

Definition at line 895 of file optional.

◆ operator=() [1/8]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
_Optional_base & std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::operator= ( _Optional_base< _Tp, _ShouldProvideDestructor > &&  __other)
inlinenoexcept

Definition at line 270 of file optional.

◆ operator=() [2/8]

template<typename _Tp >
_Optional_base & std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::operator= ( _Optional_base< _Tp, false > &&  __other)
inlinenoexcept

Definition at line 403 of file optional.

◆ operator=() [3/8]

template<typename _Tp >
template<typename _Up = _Tp>
enable_if_t< __and_< __not_< is_same< optional< _Tp >, decay_t< _Up > > >, is_constructible< _Tp, _Up >, __not_< __and_< is_scalar< _Tp >, is_same< _Tp, decay_t< _Up > > > >, is_assignable< _Tp &, _Up > >::value, optional & > std::experimental::fundamentals_v1::optional< _Tp >::operator= ( _Up &&  __u)
inline

Definition at line 609 of file optional.

◆ operator=() [4/8]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
_Optional_base & std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::operator= ( const _Optional_base< _Tp, _ShouldProvideDestructor > &  __other)
inline

Definition at line 254 of file optional.

◆ operator=() [5/8]

template<typename _Tp >
_Optional_base & std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::operator= ( const _Optional_base< _Tp, false > &  __other)
inline

Definition at line 388 of file optional.

◆ operator=() [6/8]

template<typename _Tp >
template<typename _Up >
enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, const _Up & >, is_assignable< _Tp &, _Up >, __not_< __converts_from_optional< _Tp, _Up > >, __not_< __assigns_from_optional< _Tp, _Up > > >::value, optional & > std::experimental::fundamentals_v1::optional< _Tp >::operator= ( const optional< _Up > &  __u)
inline

Definition at line 628 of file optional.

◆ operator=() [7/8]

template<typename _Tp >
optional & std::experimental::fundamentals_v1::optional< _Tp >::operator= ( nullopt_t  )
inlinenoexcept

Definition at line 595 of file optional.

◆ operator=() [8/8]

template<typename _Tp >
template<typename _Up >
enable_if_t< __and_< __not_< is_same< _Tp, _Up > >, is_constructible< _Tp, _Up >, is_assignable< _Tp &, _Up >, __not_< __converts_from_optional< _Tp, _Up > >, __not_< __assigns_from_optional< _Tp, _Up > > >::value, optional & > std::experimental::fundamentals_v1::optional< _Tp >::operator= ( optional< _Up > &&  __u)
inline

Definition at line 653 of file optional.

◆ operator==() [1/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator== ( const _Tp &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 917 of file optional.

◆ operator==() [2/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator== ( const optional< _Tp > &  __lhs,
const _Tp &  __rhs 
)
constexpr

Definition at line 912 of file optional.

◆ operator==() [3/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator== ( const optional< _Tp > &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 815 of file optional.

◆ operator==() [4/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator== ( const optional< _Tp > &  __lhs,
nullopt_t   
)
constexprnoexcept

Definition at line 851 of file optional.

◆ operator==() [5/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator== ( nullopt_t  ,
const optional< _Tp > &  __rhs 
)
constexprnoexcept

Definition at line 856 of file optional.

◆ operator>() [1/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator> ( const _Tp &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 947 of file optional.

◆ operator>() [2/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator> ( const optional< _Tp > &  __lhs,
const _Tp &  __rhs 
)
constexpr

Definition at line 942 of file optional.

◆ operator>() [3/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator> ( const optional< _Tp > &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 835 of file optional.

◆ operator>() [4/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator> ( const optional< _Tp > &  __lhs,
nullopt_t   
)
constexprnoexcept

Definition at line 881 of file optional.

◆ operator>() [5/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator> ( nullopt_t  ,
const optional< _Tp > &   
)
constexprnoexcept

Definition at line 886 of file optional.

◆ operator>=() [1/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator>= ( const _Tp &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 967 of file optional.

◆ operator>=() [2/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator>= ( const optional< _Tp > &  ,
nullopt_t   
)
constexprnoexcept

Definition at line 901 of file optional.

◆ operator>=() [3/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator>= ( const optional< _Tp > &  __lhs,
const _Tp &  __rhs 
)
constexpr

Definition at line 962 of file optional.

◆ operator>=() [4/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator>= ( const optional< _Tp > &  __lhs,
const optional< _Tp > &  __rhs 
)
constexpr

Definition at line 845 of file optional.

◆ operator>=() [5/5]

template<typename _Tp >
constexpr bool std::experimental::fundamentals_v1::operator>= ( nullopt_t  ,
const optional< _Tp > &  __rhs 
)
constexprnoexcept

Definition at line 906 of file optional.

◆ swap() [1/2]

template<typename _Tp >
void std::experimental::fundamentals_v1::optional< _Tp >::swap ( optional< _Tp > &  __other)
inlinenoexcept

Definition at line 691 of file optional.

◆ swap() [2/2]

template<typename _Tp >
void std::experimental::fundamentals_v1::swap ( optional< _Tp > &  __lhs,
optional< _Tp > &  __rhs 
)
inlinenoexcept

Definition at line 973 of file optional.

◆ value() [1/4]

template<typename _Tp >
constexpr _Tp & std::experimental::fundamentals_v1::optional< _Tp >::value ( ) &
inlineconstexpr

Definition at line 756 of file optional.

◆ value() [2/4]

template<typename _Tp >
constexpr _Tp && std::experimental::fundamentals_v1::optional< _Tp >::value ( ) &&
inlineconstexpr

Definition at line 766 of file optional.

◆ value() [3/4]

template<typename _Tp >
constexpr const _Tp & std::experimental::fundamentals_v1::optional< _Tp >::value ( ) const &
inlineconstexpr

Definition at line 746 of file optional.

◆ value() [4/4]

template<typename _Tp >
constexpr const _Tp && std::experimental::fundamentals_v1::optional< _Tp >::value ( ) const &&
inlineconstexpr

Definition at line 776 of file optional.

◆ value_or() [1/2]

template<typename _Tp >
template<typename _Up >
_Tp std::experimental::fundamentals_v1::optional< _Tp >::value_or ( _Up &&  __u) &&
inline

Definition at line 800 of file optional.

◆ value_or() [2/2]

template<typename _Tp >
template<typename _Up >
constexpr _Tp std::experimental::fundamentals_v1::optional< _Tp >::value_or ( _Up &&  __u) const &
inlineconstexpr

Definition at line 787 of file optional.

Variable Documentation

◆ _M_empty [1/4]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
_Empty_byte std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_empty

Definition at line 338 of file optional.

◆ [] [2/4]

_Empty_byte std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor > { ... } ::_M_empty

Definition at line 338 of file optional.

◆ _M_empty [3/4]

template<typename _Tp >
_Empty_byte std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_empty

Definition at line 462 of file optional.

◆ [] [4/4]

_Empty_byte std::experimental::fundamentals_v1::_Optional_base< _Tp, false > { ... } ::_M_empty

Definition at line 462 of file optional.

◆ _M_payload [1/4]

template<typename _Tp , bool _ShouldProvideDestructor = !is_trivially_destructible<_Tp>::value>
_Stored_type std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor >::_M_payload

Definition at line 339 of file optional.

◆ [] [2/4]

_Stored_type std::experimental::fundamentals_v1::_Optional_base< _Tp, _ShouldProvideDestructor > { ... } ::_M_payload

Definition at line 339 of file optional.

◆ _M_payload [3/4]

template<typename _Tp >
_Stored_type std::experimental::fundamentals_v1::_Optional_base< _Tp, false >::_M_payload

Definition at line 463 of file optional.

◆ [] [4/4]

_Stored_type std::experimental::fundamentals_v1::_Optional_base< _Tp, false > { ... } ::_M_payload

Definition at line 463 of file optional.

◆ in_place

constexpr in_place_t std::experimental::fundamentals_v1::in_place
constexpr

Tag for in-place construction.

Definition at line 90 of file optional.

◆ nullopt

constexpr nullopt_t std::experimental::fundamentals_v1::nullopt
constexpr

Tag to disengage optional objects.

Definition at line 109 of file optional.