Quick Links:

bal | bbl | bdl | bsl

Public Member Functions | Public Attributes | Protected Member Functions

bsl::optional< TYPE, false > Class Template Reference

#include <bslstl_optional.h>

List of all members.

Public Member Functions

 optional () noexcept
 optional (bsl::nullopt_t) noexcept
template<class ANY_TYPE = TYPE>
 optional (ANY_TYPE &&value, typename bsl::enable_if< bsl::is_same< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE = TYPE>
 optional (ANY_TYPE &&value, typename bsl::enable_if< bsl::is_same< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE = TYPE>
 optional (ANY_TYPE &&value, typename bsl::enable_if< BloombergLP::bslstl::Optional_ConstructsFromType< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE = TYPE>
 optional (ANY_TYPE &&value, typename bsl::enable_if< BloombergLP::bslstl::Optional_ConstructsFromType< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE >
 optional (const optional< ANY_TYPE > &original, typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< bsl::is_convertible< const ANY_TYPE &, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE >
 optional (const optional< ANY_TYPE > &original, typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_convertible< const ANY_TYPE &, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE >
 optional (optional< ANY_TYPE > &&original, typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE >
 optional (optional< ANY_TYPE > &&original, typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE = TYPE>
 optional (const std::optional< ANY_TYPE > &original, typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE = TYPE>
 optional (const std::optional< ANY_TYPE > &original, typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE = TYPE>
 optional (std::optional< ANY_TYPE > &&original, typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class ANY_TYPE = TYPE>
 optional (std::optional< ANY_TYPE > &&original, typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType)
template<class... ARGS>
 optional (bsl::in_place_t, ARGS &&...args)
template<class INIT_LIST_TYPE , class... ARGS>
 optional (bsl::in_place_t, std::initializer_list< INIT_LIST_TYPE > il, ARGS &&...args)
optionaloperator= (bsl::nullopt_t) noexcept

Public Attributes

bsl::enable_if
< !(bsl::is_convertible< const
bsl::optional< typename
bsl::remove_cvref< const
ANY_TYPE & >::type > &, TYPE >
::value||bsl::is_convertible
< bsl::optional< typename
bsl::remove_cvref< const
ANY_TYPE & >::type > &, TYPE >
::value||bsl::is_convertible
< const bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
, TYPE >::value||bsl::is_convertible
< bsl::optional< typename
bsl::remove_cvref< const
ANY_TYPE & >::type >, TYPE >
::value||std::is_constructible
< TYPE, const bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_constructible
< TYPE, bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_constructible
< TYPE, const bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value||std::is_constructible
< TYPE, bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value)&&std::is_constructible
< TYPE, const ANY_TYPE & >
::value &&std::is_assignable
< TYPE &, const ANY_TYPE & >
::value &&!(std::is_assignable
< TYPE &, const bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_assignable
< TYPE &, bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_assignable
< TYPE &, const bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value||std::is_assignable
< TYPE &, bsl::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value), optional< TYPE >
>::type
operator= (const optional< ANY_TYPE > &rhs)
bsl::enable_if
< !(bsl::is_convertible< const
bsl::optional< typename
bsl::remove_cvref< ANY_TYPE >
::type > &, TYPE >::value||bsl::is_convertible
< bsl::optional< typename
bsl::remove_cvref< ANY_TYPE >
::type > &, TYPE >::value||bsl::is_convertible
< const bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >, TYPE >
::value||bsl::is_convertible
< bsl::optional< typename
bsl::remove_cvref< ANY_TYPE >
::type >, TYPE >::value||std::is_constructible
< TYPE, const bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_constructible
< TYPE, bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_constructible
< TYPE, const bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value||std::is_constructible
< TYPE, bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value)&&std::is_constructible
< TYPE, ANY_TYPE >::value
&&std::is_assignable< TYPE
&, ANY_TYPE >::value
&&!(std::is_assignable< TYPE
&, const bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_assignable
< TYPE &, bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_assignable
< TYPE &, const bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value||std::is_assignable
< TYPE &, bsl::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value),
optional< TYPE > >::type
operator= (optional< ANY_TYPE > &&rhs)
bsl::enable_if
< !(bsl::is_convertible< const
std::optional< typename
bsl::remove_cvref< const
ANY_TYPE & >::type > &, TYPE >
::value||bsl::is_convertible
< std::optional< typename
bsl::remove_cvref< const
ANY_TYPE & >::type > &, TYPE >
::value||bsl::is_convertible
< const std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
, TYPE >::value||bsl::is_convertible
< std::optional< typename
bsl::remove_cvref< const
ANY_TYPE & >::type >, TYPE >
::value||std::is_constructible
< TYPE, const std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_constructible
< TYPE, std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_constructible
< TYPE, const std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value||std::is_constructible
< TYPE, std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value)&&std::is_constructible
< TYPE, const ANY_TYPE & >
::value &&std::is_assignable
< TYPE &, const ANY_TYPE & >
::value &&!(std::is_assignable
< TYPE &, const std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_assignable
< TYPE &, std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
& >::value||std::is_assignable
< TYPE &, const std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value||std::is_assignable
< TYPE &, std::optional
< typename bsl::remove_cvref
< const ANY_TYPE & >::type >
>::value), optional< TYPE >
>::type
operator= (const std::optional< ANY_TYPE > &rhs)
bsl::enable_if
< !(bsl::is_convertible< const
std::optional< typename
bsl::remove_cvref< ANY_TYPE >
::type > &, TYPE >::value||bsl::is_convertible
< std::optional< typename
bsl::remove_cvref< ANY_TYPE >
::type > &, TYPE >::value||bsl::is_convertible
< const std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >, TYPE >
::value||bsl::is_convertible
< std::optional< typename
bsl::remove_cvref< ANY_TYPE >
::type >, TYPE >::value||std::is_constructible
< TYPE, const std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_constructible
< TYPE, std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_constructible
< TYPE, const std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value||std::is_constructible
< TYPE, std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value)&&std::is_constructible
< TYPE, ANY_TYPE >::value
&&std::is_assignable< TYPE
&, ANY_TYPE >::value
&&!(std::is_assignable< TYPE
&, const std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_assignable
< TYPE &, std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type >
& >::value||std::is_assignable
< TYPE &, const std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value||std::is_assignable
< TYPE &, std::optional
< typename bsl::remove_cvref
< ANY_TYPE >::type > >::value),
optional< TYPE > >::type
operator= (std::optional< ANY_TYPE > &&rhs)
bsl::enable_if
< !::BloombergLP::bslmf::IsAccessibleBaseOf
< bsl::optional< TYPE >
, typename bsl::remove_cvref
< ANY_TYPE >::type >::value
&&!(bsl::is_same< TYPE,
typename bsl::decay< ANY_TYPE >
::type >::value
&&std::is_scalar< TYPE >
::value)&&std::is_constructible
< TYPE, ANY_TYPE >::value
&&std::is_assignable< TYPE
&, ANY_TYPE >::value, optional
< TYPE > >::type
operator= (ANY_TYPE &&rhs)

Protected Member Functions

TYPE & dereferenceRaw ()
const TYPE & dereferenceRaw () const

Detailed Description

template<class TYPE>
class bsl::optional< TYPE, false >

Specialization of optional for value_type that is not allocator-aware when std::optional is available.

See Component bslstl_optional


Constructor & Destructor Documentation

template<class TYPE >
bsl::optional< TYPE, false >::optional (  ) 

Create a disengaged optional object.

template<class TYPE >
bsl::optional< TYPE, false >::optional ( bsl::nullopt_t   ) 

IMPLICIT: Create a disengaged optional object.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( ANY_TYPE &&  value,
typename bsl::enable_if< bsl::is_same< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
)

Create an optional object having the same value as the specified value object by forwarding the contents of value to the newly-created object.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( ANY_TYPE &&  value,
typename bsl::enable_if< bsl::is_same< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
) [explicit]

Create an optional object having the same value as the specified value object by forwarding the contents of value to the newly-created object.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( ANY_TYPE &&  value,
typename bsl::enable_if< BloombergLP::bslstl::Optional_ConstructsFromType< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
)

Create an optional object having the same value as the specified value object by forwarding the contents of value to the newly-created object.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( ANY_TYPE &&  value,
typename bsl::enable_if< BloombergLP::bslstl::Optional_ConstructsFromType< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
) [explicit]

Create an optional object having the same value as the specified value object by forwarding the contents of value to the newly-created object.

template<class TYPE >
template<class ANY_TYPE >
bsl::optional< TYPE, false >::optional ( const optional< ANY_TYPE > &  original,
typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< bsl::is_convertible< const ANY_TYPE &, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
)

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise.

template<class TYPE >
template<class ANY_TYPE >
bsl::optional< TYPE, false >::optional ( const optional< ANY_TYPE > &  original,
typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !bsl::is_convertible< const ANY_TYPE &, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
) [explicit]

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise.

template<class TYPE >
template<class ANY_TYPE >
bsl::optional< TYPE, false >::optional ( optional< ANY_TYPE > &&  original,
typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
)

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise. original is left in a valid but unspecified state.

template<class TYPE >
template<class ANY_TYPE >
bsl::optional< TYPE, false >::optional ( optional< ANY_TYPE > &&  original,
typename bsl::enable_if< !bsl::is_same< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !(bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, bsl::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
) [explicit]

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise. original is left in a valid but unspecified state.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( const std::optional< ANY_TYPE > &  original,
typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
)

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( const std::optional< ANY_TYPE > &  original,
typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< const ANY_TYPE & >::type > >::value)&&std::is_constructible< TYPE, const ANY_TYPE & >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
) [explicit]

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( std::optional< ANY_TYPE > &&  original,
typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
)

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise. original is left in a valid but unspecified state.

template<class TYPE >
template<class ANY_TYPE = TYPE>
bsl::optional< TYPE, false >::optional ( std::optional< ANY_TYPE > &&  original,
typename bsl::enable_if< !(bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > &, TYPE >::value||bsl::is_convertible< const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||bsl::is_convertible< std::optional< typename bsl::remove_cvref< ANY_TYPE >::type >, TYPE >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > & >::value||std::is_constructible< TYPE, const std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value||std::is_constructible< TYPE, std::optional< typename bsl::remove_cvref< ANY_TYPE >::type > >::value)&&std::is_constructible< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType,
typename bsl::enable_if< !bsl::is_convertible< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type  = BloombergLP::bslstl::optNoSuchType 
) [explicit]

Create a disengaged optional object if the specified original object is disengaged, and an optional object with the value of original.value() (of ANY_TYPE) converted to TYPE otherwise. original is left in a valid but unspecified state.

template<class TYPE >
template<class... ARGS>
bsl::optional< TYPE, false >::optional ( bsl::in_place_t  ,
ARGS &&...  args 
) [explicit]

Create an optional object having the value of the (template parameter) TYPE created in place using the specified args.

template<class TYPE >
template<class INIT_LIST_TYPE , class... ARGS>
bsl::optional< TYPE, false >::optional ( bsl::in_place_t  ,
std::initializer_list< INIT_LIST_TYPE >  il,
ARGS &&...  args 
) [explicit]

Create an optional object having the value of the (template parameter) TYPE created in place using the specified il and the specified args.


Member Function Documentation

template<class TYPE >
optional& bsl::optional< TYPE, false >::operator= ( bsl::nullopt_t   ) 

reset the optional to a disengaged state.

template<class TYPE >
TYPE& bsl::optional< TYPE, false >::dereferenceRaw (  )  [protected]

Return a reference providing modifiable access to the underlying TYPE object. The behavior is undefined if the optional object is disengaged. Note that this function is only intended to be called by bdlb::NullableValue::value during transition of its implementation to use 'bsloptional. Note that ref-qualified versions of value() are not provided because NullableValue does not require them.

template<class TYPE >
const TYPE& bsl::optional< TYPE, false >::dereferenceRaw (  )  const [protected]

Return a reference providing non-modifiable access to the underlying TYPE object. The behavior is undefined if the optional object is disengaged. Note that this function is only intended to be called by bdlb::NullableValue::value during transition of its implementation to use 'bsloptional. Note that ref-qualified versions of value() are not provided because NullableValue does not require them.


Member Data Documentation

template<class TYPE >
bsl::enable_if< !(bsl::is_convertible<const bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &, TYPE >::value || bsl::is_convertible< bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &, TYPE >::value || bsl::is_convertible<const bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> , TYPE >::value || bsl::is_convertible< bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> , TYPE >::value || std::is_constructible< TYPE , const bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> & >::value || std::is_constructible< TYPE , bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> & >::value || std::is_constructible< TYPE , const bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value || std::is_constructible< TYPE , bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value) && std::is_constructible< TYPE , const ANY_TYPE& >::value && std::is_assignable< TYPE & , const ANY_TYPE& >::value && !(std::is_assignable< TYPE &, const bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &>::value || std::is_assignable< TYPE &, bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &>::value || std::is_assignable< TYPE &, const bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value || std::is_assignable< TYPE &, bsl::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value), optional< TYPE > >::type& bsl::optional< TYPE, false >::operator=(const optional< ANY_TYPE > &rhs)

Disengage this object if the specified rhs object is disengaged, and assign to this object the value of rhs.value() (of ANY_TYPE) converted to TYPE otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless TYPE and ANY_TYPE are compatible.

template<class TYPE >
bsl::enable_if< !(bsl::is_convertible<const bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &, TYPE >::value || bsl::is_convertible< bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &, TYPE >::value || bsl::is_convertible<const bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> , TYPE >::value || bsl::is_convertible< bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> , TYPE >::value || std::is_constructible< TYPE , const bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> & >::value || std::is_constructible< TYPE , bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> & >::value || std::is_constructible< TYPE , const bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value || std::is_constructible< TYPE , bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value) && std::is_constructible< TYPE , ANY_TYPE >::value && std::is_assignable< TYPE & , ANY_TYPE >::value && !(std::is_assignable< TYPE &, const bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &>::value || std::is_assignable< TYPE &, bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &>::value || std::is_assignable< TYPE &, const bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value || std::is_assignable< TYPE &, bsl::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value), optional< TYPE > >::type& bsl::optional< TYPE, false >::operator=(optional< ANY_TYPE > &&rhs)

Disengage this object if the specified rhs object is disengaged, and move assign to this object the value of rhs.value() (of ANY_TYPE) converted to TYPE otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless TYPE and ANY_TYPE are compatible.

template<class TYPE >
bsl::enable_if< !(bsl::is_convertible<const std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &, TYPE >::value || bsl::is_convertible< std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &, TYPE >::value || bsl::is_convertible<const std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> , TYPE >::value || bsl::is_convertible< std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> , TYPE >::value || std::is_constructible< TYPE , const std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> & >::value || std::is_constructible< TYPE , std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> & >::value || std::is_constructible< TYPE , const std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value || std::is_constructible< TYPE , std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value) && std::is_constructible< TYPE , const ANY_TYPE& >::value && std::is_assignable< TYPE & , const ANY_TYPE& >::value && !(std::is_assignable< TYPE &, const std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &>::value || std::is_assignable< TYPE &, std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> &>::value || std::is_assignable< TYPE &, const std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value || std::is_assignable< TYPE &, std::optional<typename bsl::remove_cvref< const ANY_TYPE& >::type> >::value), optional< TYPE > >::type& bsl::optional< TYPE, false >::operator=(const std::optional< ANY_TYPE > &rhs)

Disengage this object if the specified rhs object is disengaged, and assign to this object the value of rhs.value() (of ANY_TYPE) converted to TYPE otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless TYPE and ANY_TYPE are compatible.

template<class TYPE >
bsl::enable_if< !(bsl::is_convertible<const std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &, TYPE >::value || bsl::is_convertible< std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &, TYPE >::value || bsl::is_convertible<const std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> , TYPE >::value || bsl::is_convertible< std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> , TYPE >::value || std::is_constructible< TYPE , const std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> & >::value || std::is_constructible< TYPE , std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> & >::value || std::is_constructible< TYPE , const std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value || std::is_constructible< TYPE , std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value) && std::is_constructible< TYPE , ANY_TYPE >::value && std::is_assignable< TYPE & , ANY_TYPE >::value && !(std::is_assignable< TYPE &, const std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &>::value || std::is_assignable< TYPE &, std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> &>::value || std::is_assignable< TYPE &, const std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value || std::is_assignable< TYPE &, std::optional<typename bsl::remove_cvref< ANY_TYPE >::type> >::value), optional< TYPE > >::type& bsl::optional< TYPE, false >::operator=(std::optional< ANY_TYPE > &&rhs)

Disengage this object if the specified rhs object is disengaged, and move assign to this object the value of rhs.value() (of ANY_TYPE) converted to TYPE otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless TYPE and ANY_TYPE are compatible.

template<class TYPE >
bsl::enable_if< !::BloombergLP::bslmf::IsAccessibleBaseOf< bsl::optional< TYPE >, typename bsl::remove_cvref< ANY_TYPE >::type>::value && !(bsl::is_same< TYPE , typename bsl::decay< ANY_TYPE >::type>::value && std::is_scalar< TYPE >::value) && std::is_constructible< TYPE , ANY_TYPE >::value && std::is_assignable< TYPE & , ANY_TYPE >::value, optional< TYPE > >::type& bsl::optional< TYPE, false >::operator=(ANY_TYPE &&rhs)

Assign to this object the value of the specified rhs object converted to TYPE, and return a reference providing modifiable access to this object. Note that this method may invoke assignment from rhs, or construction from rhs, depending on whether this object is engaged. BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_FORWARD_REF(TYPE, ANY_TYPE) contains a check that disables this overload if ANY_TYPE is optional<TYPE>. This is needed to prevent this assignment operator being a better match for non const optional<TYPE> lvalues than operator=(const optional& rhs). This function needs to be a worse match than operator=(optional) so cases like :

            bsl::optional<int> oi;
            oi = {};

represent assignment from a default constructed optional, as opposed to assignment from default constructed value_type. Note that in C++03, where there is no concept of perfect forwarding, this is not a concern.


The documentation for this class was generated from the following file: