Quick Links: |
#include <bslstl_optional.h>
Public Types | |
typedef TYPE | value_type |
typedef bsl::allocator< char > | allocator_type |
Public Member Functions | |
BSLMF_NESTED_TRAIT_DECLARATION (optional, BloombergLP::bslma::UsesBslmaAllocator) | |
BSLMF_NESTED_TRAIT_DECLARATION (optional, BloombergLP::bslmf::UsesAllocatorArgT) | |
BSLMF_NESTED_TRAIT_DECLARATION_IF (optional, BloombergLP::bslmf::IsBitwiseMoveable, BloombergLP::bslmf::IsBitwiseMoveable< TYPE >::value) | |
optional () BSLS_KEYWORD_NOEXCEPT | |
optional (bsl::nullopt_t) BSLS_KEYWORD_NOEXCEPT | |
optional (const optional &original) | |
template<class ANY_TYPE > | |
optional (BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) value, 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< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType) | |
template<class ANY_TYPE > | |
optional (BSLS_COMPILERFEATURES_FORWARD_REF(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 (BSLS_COMPILERFEATURES_FORWARD_REF(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 (BSLMF_MOVABLEREF_DEDUCE(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< !BloombergLP::bslstl::Optional_PropagatesAllocator< 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 (BSLMF_MOVABLEREF_DEDUCE(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< !BloombergLP::bslstl::Optional_PropagatesAllocator< 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 (BSLMF_MOVABLEREF_DEDUCE(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< BloombergLP::bslstl::Optional_PropagatesAllocator< 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 (BSLMF_MOVABLEREF_DEDUCE(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< BloombergLP::bslstl::Optional_PropagatesAllocator< 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, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) | |
template<class INIT_LIST_TYPE , class... ARGS> | |
optional (bsl::in_place_t, std::initializer_list< INIT_LIST_TYPE > il, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) | |
optional (bsl::allocator_arg_t, allocator_type allocator) | |
optional (bsl::allocator_arg_t, allocator_type allocator, bsl::nullopt_t) | |
optional (bsl::allocator_arg_t, allocator_type allocator, const optional &original) | |
optional (bsl::allocator_arg_t, allocator_type allocator, BloombergLP::bslmf::MovableRef< optional > original) | |
template<class DERIVED > | |
optional (bsl::allocator_arg_t, allocator_type allocator, BloombergLP::bslmf::MovableRef< DERIVED > original, typename bsl::enable_if< !bsl::is_same< optional, DERIVED >::value &&BloombergLP::bslmf::IsAccessibleBaseOf< optional, DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_same< optional, DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType) | |
template<class ANY_TYPE > | |
optional (bsl::allocator_arg_t, allocator_type allocator, BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) value, typename bsl::enable_if< bsl::is_same< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType) | |
template<class ANY_TYPE > | |
optional (bsl::allocator_arg_t, allocator_type allocator, BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) value, typename bsl::enable_if< BloombergLP::bslstl::Optional_ConstructsFromType< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType) | |
template<class ANY_TYPE > | |
optional (bsl::allocator_arg_t, allocator_type allocator, 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) | |
template<class ANY_TYPE > | |
optional (bsl::allocator_arg_t, allocator_type allocator, BSLMF_MOVABLEREF_DEDUCE(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) | |
template<class ANY_TYPE = TYPE> | |
optional (bsl::allocator_arg_t, allocator_type allocator, 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) | |
template<class ANY_TYPE = TYPE> | |
optional (bsl::allocator_arg_t, allocator_type allocator, 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) | |
template<class... ARGS> | |
optional (bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_t, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) | |
template<class INIT_LIST_TYPE , class... ARGS> | |
optional (bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_t, std::initializer_list< INIT_LIST_TYPE > initializer_list, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) | |
template<class... ARGS> | |
TYPE & | emplace (BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) |
template<class INIT_LIST_TYPE , class... ARGS> | |
TYPE & | emplace (std::initializer_list< INIT_LIST_TYPE > il, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...) |
void | reset () BSLS_KEYWORD_NOEXCEPT |
optional & | operator= (bsl::nullopt_t) BSLS_KEYWORD_NOEXCEPT |
optional & | operator= (const optional &rhs) |
optional & | operator= (BloombergLP::bslmf::MovableRef< optional > rhs) |
template<class DERIVED > | |
bsl::enable_if < BloombergLP::bslmf::IsAccessibleBaseOf < bsl::optional< TYPE > , DERIVED >::value &&!bsl::is_same< bsl::optional < TYPE >, DERIVED >::value, optional< TYPE > >::type & | operator= (BloombergLP::bslmf::MovableRef< DERIVED > rhs) |
optional & | operator= (const TYPE &rhs) |
optional & | operator= (BloombergLP::bslmf::MovableRef< TYPE > rhs) |
template<class ANY_TYPE > | |
bsl::enable_if < !::BloombergLP::bslmf::IsAccessibleBaseOf < bsl::optional< TYPE > , typename bsl::remove_cv < typename::BloombergLP::bslmf::MovableRefUtil::RemoveReference < ANY_TYPE >::type >::type > ::value, optional< TYPE > >::type & | operator= (const ANY_TYPE &rhs) |
template<class ANY_TYPE > | |
bsl::enable_if < !::BloombergLP::bslmf::IsAccessibleBaseOf < bsl::optional< TYPE > , typename bsl::remove_cv < typename::BloombergLP::bslmf::MovableRefUtil::RemoveReference < ANY_TYPE >::type >::type > ::value, optional< TYPE > >::type & | operator= (BloombergLP::bslmf::MovableRef< ANY_TYPE > rhs) |
TYPE * | operator-> () |
TYPE & | operator* () |
allocator_type | get_allocator () const BSLS_KEYWORD_NOEXCEPT |
bool | has_value () const BSLS_KEYWORD_NOEXCEPT |
const TYPE & | value () const |
const TYPE * | operator-> () const |
const TYPE & | operator* () const |
template<class ANY_TYPE > | |
TYPE | value_or (BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) value) const |
operator UnspecifiedBool () const BSLS_NOTHROW_SPEC | |
Public Attributes | |
optional(BloombergLP::bslmf::MovableRef < optional > original) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl optional(BloombergLP::bslmf::MovableRef < DERIVED > original, typename bsl::enable_if< !bsl::is_same < optional, DERIVED >::value &&BloombergLP::bslmf::IsAccessibleBaseOf < optional, DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType > ::type=BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if < !bsl::is_same< optional, DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType > ::type=BloombergLP::bslstl::optNoSuchType) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl | optional (BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) value, 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< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType) |
void swap(optional &other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION(bsl TYPE & | value () |
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= (BSLMF_MOVABLEREF_DEDUCE(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) |
Protected Member Functions | |
TYPE & | dereferenceRaw () |
const TYPE & | dereferenceRaw () const |
This class template provides an STL-compliant implementation of optional
type. The main template is instantiated for allocator-aware types and holds an allocator used to create all objects of value_type
managed by the optional
object.
typedef TYPE bsl::optional< TYPE, USES_BSLMA_ALLOC >::value_type |
typedef bsl::allocator<char> bsl::optional< TYPE, USES_BSLMA_ALLOC >::allocator_type |
Reimplemented in bdlb::NullableValue< TYPE >, bdlb::NullableValue< Choice1 >, bdlb::NullableValue< double >, bdlb::NullableValue< Choice3 >, bdlb::NullableValue< CustomInt >, bdlb::NullableValue< bdlt::DatetimeTz >, bdlb::NullableValue< bsl::vector< char > >, bdlb::NullableValue< int >, bdlb::NullableValue< unsigned int >, bdlb::NullableValue< unsigned char >, bdlb::NullableValue< SequenceWithAnonymityChoice2 >, bdlb::NullableValue< CustomString >, bdlb::NullableValue< bool >, bdlb::NullableValue< Enumerated::Value >, and bdlb::NullableValue< bsl::string >.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | ) |
Create a disengaged optional
object. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::nullopt_t | ) |
IMPLICIT: Create a disengaged optional
object. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | const optional< TYPE, USES_BSLMA_ALLOC > & | original | ) |
IMPLICIT: Create an optional
object having the value of the specified original
object. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) | value, | |
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< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type | = BloombergLP::bslstl::optNoSuchType | |||
) | [explicit] |
Create an optional
object having the specified value
. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | BSLS_COMPILERFEATURES_FORWARD_REF(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 specified value
(of ANY_TYPE
) converted to TYPE
. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | BSLS_COMPILERFEATURES_FORWARD_REF(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 specified value
(of ANY_TYPE
) converted to TYPE
. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::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 | |||
) | [inline] |
bsl::optional< TYPE, USES_BSLMA_ALLOC >::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 | |||
) | [inline, explicit] |
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | BSLMF_MOVABLEREF_DEDUCE(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< !BloombergLP::bslstl::Optional_PropagatesAllocator< 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. Use the currently installed default allocator to supply memory. original
is left in a valid but unspecified state.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | BSLMF_MOVABLEREF_DEDUCE(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< !BloombergLP::bslstl::Optional_PropagatesAllocator< 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. Use the currently installed default allocator to supply memory. original
is left in a valid but unspecified state.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | BSLMF_MOVABLEREF_DEDUCE(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< BloombergLP::bslstl::Optional_PropagatesAllocator< 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()
otherwise. This is a special case constructor where ANY_TYPE
is a non-const version of TYPE
and we use the allocator from original
to supply memory. original
is left in a valid but unspecified state.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | BSLMF_MOVABLEREF_DEDUCE(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< BloombergLP::bslstl::Optional_PropagatesAllocator< 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()
otherwise. This is a special case constructor where ANY_TYPE
is a non-const version of TYPE
and we use the allocator from original
to supply memory. original
is left in a valid but unspecified state.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::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. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::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. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::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. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::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. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::in_place_t | , | |
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | |||
) | [explicit] |
Create an optional
object having the value of the (template parameter) TYPE
created in place using the specified args
. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::in_place_t | , | |
std::initializer_list< INIT_LIST_TYPE > | il, | |||
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | |||
) | [explicit] |
Create an optional
object having the value of the (template parameter) TYPE
created in place using the specified il
and specified args
. Use the currently installed default allocator to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator | |||
) |
Create a disengaged optional
object. Use the specified allocator
to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
bsl::nullopt_t | ||||
) |
Create a disengaged optional
object. Use the specified allocator
to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
const optional< TYPE, USES_BSLMA_ALLOC > & | original | |||
) |
If specified original
contains a value, initialize the contained value_type
object with *original
. Otherwise, create a disengaged optional
object. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
BloombergLP::bslmf::MovableRef< optional< TYPE, USES_BSLMA_ALLOC > > | original | |||
) |
Create a optional
object having the same value as the specified original
object by moving the contents of original
to the newly-created object. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
BloombergLP::bslmf::MovableRef< DERIVED > | original, | |||
typename bsl::enable_if< !bsl::is_same< optional< TYPE, USES_BSLMA_ALLOC >, DERIVED >::value &&BloombergLP::bslmf::IsAccessibleBaseOf< optional< TYPE, USES_BSLMA_ALLOC >, DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type | = BloombergLP::bslstl::optNoSuchType , |
|||
typename bsl::enable_if< !bsl::is_same< optional< TYPE, USES_BSLMA_ALLOC >, DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type | = BloombergLP::bslstl::optNoSuchType | |||
) |
Create a optional
object having the same value as the base class of the specified original
object by moving the contents of original
to the newly-created object. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory. Note that this constructor does not participate in overload resolution unless optional
is an accessible base class of DERIVED
.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) | value, | |||
typename bsl::enable_if< bsl::is_same< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type | = BloombergLP::bslstl::optNoSuchType | |||
) | [explicit] |
Create an optional
object having the specified value
. Use the specified allocator
to supply memory. Note that this overload is selected if ANY_TYPE == TYPE
.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) | value, | |||
typename bsl::enable_if< BloombergLP::bslstl::Optional_ConstructsFromType< TYPE, ANY_TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type | = BloombergLP::bslstl::optNoSuchType | |||
) | [explicit] |
Create an optional
object having the specified value
(of ANY_TYPE
) converted to TYPE
. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory. value
is left in a valid but unspecified state. Note that this constructor does not participate in overload resolution unless ANY_TYPE
is convertible to TYPE
.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
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 | |||
) | [explicit] |
Create an optional
object having the value of the specified original
object. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
BSLMF_MOVABLEREF_DEDUCE(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 | |||
) | [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. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory. original
is left in a valid but unspecified state.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
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 | |||
) | [explicit] |
If specified original
contains a value, initialize the value_type
object with *original
. Otherwise, create a disengaged optional
object. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
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 | |||
) | [explicit] |
If specified original
contains a value, initialize the value_type
object by move construction from *original
. Otherwise, create a disengaged optional
object. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
bsl::in_place_t | , | |||
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | |||
) | [explicit] |
Create the value_type
object using the specified arguments. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory for this and any future value_type
objects.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional | ( | bsl::allocator_arg_t | , | |
allocator_type | allocator, | |||
bsl::in_place_t | , | |||
std::initializer_list< INIT_LIST_TYPE > | initializer_list, | |||
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | |||
) | [explicit] |
Create the value_type
object using the specified initializer_list
and arguments. Use the specified allocator
(e.g., the address of a bslma::Allocator
object) to supply memory.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::BSLMF_NESTED_TRAIT_DECLARATION | ( | optional< TYPE, USES_BSLMA_ALLOC > | , | |
BloombergLP::bslma::UsesBslmaAllocator | ||||
) |
bsl::optional< TYPE, USES_BSLMA_ALLOC >::BSLMF_NESTED_TRAIT_DECLARATION | ( | optional< TYPE, USES_BSLMA_ALLOC > | , | |
BloombergLP::bslmf::UsesAllocatorArgT | ||||
) |
bsl::optional< TYPE, USES_BSLMA_ALLOC >::BSLMF_NESTED_TRAIT_DECLARATION_IF | ( | optional< TYPE, USES_BSLMA_ALLOC > | , | |
BloombergLP::bslmf::IsBitwiseMoveable | , | |||
BloombergLP::bslmf::IsBitwiseMoveable< TYPE >::value | ||||
) |
TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::emplace | ( | BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | ) |
Assign to this optional
object the value of the (template parameter) TYPE
created in place using the specified args
and return a reference providing modifiable access to the underlying TYPE
object. If this optional
object already contains an object (true == hasValue()
), that object is destroyed before the new object is created. The allocator specified at the construction of this optional
object is used to supply memory to the value object. Attempts to explicitly specify via args
another allocator to supply memory to the created (value) object are disallowed by the compiler. Note that if the constructor of TYPE
throws an exception this object is left in a disengaged state.
Referenced by bsl::optional< bsl::string >::optional().
TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::emplace | ( | std::initializer_list< INIT_LIST_TYPE > | il, | |
BSLS_COMPILERFEATURES_FORWARD_REF(ARGS) | ... | |||
) |
Assign to this optional
object the value of the (template parameter) TYPE
created in place using the specified il
and specified args
and return a reference providing modifiable access to the underlying TYPE
object. If this optional
object already contains an object (true == hasValue()
), that object is destroyed before the new object is created. The allocator specified at the construction of this optional
object is used to supply memory to the value object. Attempts to explicitly specify via args
another allocator to supply memory to the created (value) object are disallowed by the compiler. Note that if the constructor of TYPE
throws an exception this object is left in a disengaged state.
void bsl::optional< TYPE, USES_BSLMA_ALLOC >::reset | ( | ) |
Reset this object to the default constructed state (i.e., to a disengaged state).
optional& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | bsl::nullopt_t | ) |
Reset this object to be disengaged and return a reference providing modifiable access to this object.
optional& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | const optional< TYPE, USES_BSLMA_ALLOC > & | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a non-'const' reference to this object.
optional& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | BloombergLP::bslmf::MovableRef< optional< TYPE, USES_BSLMA_ALLOC > > | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a non-'const' reference to this object. The allocators of this object and rhs
both remain unchanged. The contents of rhs
are either move-constructed into or move-assigned to this object. rhs
is left in a valid but unspecified state.
bsl::enable_if< BloombergLP::bslmf::IsAccessibleBaseOf<bsl::optional< TYPE >, DERIVED >::value && !bsl::is_same<bsl::optional< TYPE >, DERIVED >::value, optional< TYPE > >::type& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | BloombergLP::bslmf::MovableRef< DERIVED > | rhs | ) |
Assign to this object the value of the base of the specified rhs
object, and return a non-'const' reference to this object. The allocators of this object and rhs
both remain unchanged. The contents of rhs
are either move-constructed into or move-assigned to this object. rhs
is left in a valid but unspecified state. Note that this manipulator does not participate in overload resolution unless optional
is an accessible base class of DERIVED
.
optional& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | const TYPE & | rhs | ) |
Assign to this object the value of the specified rhs
, and return a reference providing modifiable access to this object.
Reimplemented in bdlb::NullableValue< TYPE >, bdlb::NullableValue< Choice1 >, bdlb::NullableValue< double >, bdlb::NullableValue< Choice3 >, bdlb::NullableValue< CustomInt >, bdlb::NullableValue< bdlt::DatetimeTz >, bdlb::NullableValue< bsl::vector< char > >, bdlb::NullableValue< int >, bdlb::NullableValue< unsigned int >, bdlb::NullableValue< unsigned char >, bdlb::NullableValue< SequenceWithAnonymityChoice2 >, bdlb::NullableValue< CustomString >, bdlb::NullableValue< bool >, bdlb::NullableValue< Enumerated::Value >, and bdlb::NullableValue< bsl::string >.
optional& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | BloombergLP::bslmf::MovableRef< TYPE > | rhs | ) |
Assign to this object the value of the specified rhs
, and return a reference providing modifiable access to this object. The contents of rhs
are either move-constructed into or move-assigned to this object. rhs
is left in a valid but unspecified state.
bsl::enable_if< !::BloombergLP::bslmf::IsAccessibleBaseOf< bsl::optional< TYPE >, typename bsl::remove_cv< typename ::BloombergLP::bslmf::MovableRefUtil:: RemoveReference< ANY_TYPE >::type>::type>::value, optional< TYPE > >::type& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | const ANY_TYPE & | rhs | ) |
Assign to this object the value of the specified rhs
object (of ANY_TYPE
) 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 optional
object is engaged.
bsl::enable_if< !::BloombergLP::bslmf::IsAccessibleBaseOf< bsl::optional< TYPE >, typename bsl::remove_cv< typename ::BloombergLP::bslmf::MovableRefUtil:: RemoveReference< ANY_TYPE >::type>::type>::value, optional< TYPE > >::type& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator= | ( | BloombergLP::bslmf::MovableRef< ANY_TYPE > | rhs | ) |
Assign to this object the value of the specified rhs
object (of ANY_TYPE
) converted to TYPE
, and return a reference providing modifiable access to this object. The contents of rhs
are either move-constructed into or move-assigned to this object. rhs
is left in a valid but unspecified state. This overload needs to exist in C++03 because the perfect forwarding operator=
can not to be specified in terms of MovableRef
.
TYPE* bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator-> | ( | ) |
Return a pointer providing modifiable access to the underlying TYPE
object. The behavior is undefined if the optional
object is disengaged.
TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator* | ( | ) |
Return a reference providing modifiable access to the underlying TYPE
object. The behavior is undefined if the optional
object is disengaged.
allocator_type bsl::optional< TYPE, USES_BSLMA_ALLOC >::get_allocator | ( | ) | const |
Return allocator used for construction of value_type
.
bool bsl::optional< TYPE, USES_BSLMA_ALLOC >::has_value | ( | ) | const |
Return false
if this object is disengaged, and true
otherwise.
Referenced by bsl::optional< bsl::string >::operator UnspecifiedBool(), and bsl::optional< bsl::string >::optional().
const TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::value | ( | ) | const |
Return a reference providing non-modifiable access to the underlying TYPE
object. Throws a bsl::bad_optional_access
if the optional
object is disengaged.
Reimplemented in bdlb::NullableValue< TYPE >, bdlb::NullableValue< Choice1 >, bdlb::NullableValue< double >, bdlb::NullableValue< Choice3 >, bdlb::NullableValue< CustomInt >, bdlb::NullableValue< bdlt::DatetimeTz >, bdlb::NullableValue< bsl::vector< char > >, bdlb::NullableValue< int >, bdlb::NullableValue< unsigned int >, bdlb::NullableValue< unsigned char >, bdlb::NullableValue< SequenceWithAnonymityChoice2 >, bdlb::NullableValue< CustomString >, bdlb::NullableValue< bool >, bdlb::NullableValue< Enumerated::Value >, and bdlb::NullableValue< bsl::string >.
const TYPE* bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator-> | ( | ) | const |
Return a pointer providing non-modifiable access to the underlying TYPE
object. The behavior is undefined if the optional
object is disengaged.
const TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator* | ( | ) | const |
Return a reference providing non-modifiable access to the underlying TYPE
object. The behavior is undefined if the optional
object is disengaged.
TYPE bsl::optional< TYPE, USES_BSLMA_ALLOC >::value_or | ( | BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) | value | ) | const |
Return a copy of the underlying object of a (template parameter) TYPE
if this object is non-null, and the specified value
converted to TYPE
otherwise. Note that this method returns by value, so may be inefficient in some contexts.
bsl::optional< TYPE, USES_BSLMA_ALLOC >::operator UnspecifiedBool | ( | ) | const [inline] |
< Simulation of explicit conversion to bool. Inlined to work around xlC bug when out-of-line.
TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::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.
const TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::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.
optional (BloombergLP::bslmf::MovableRef<optional> original) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION( bsl optional (BloombergLP::bslmf::MovableRef<DERIVED> original, typename bsl::enable_if< !bsl::is_same<optional, DERIVED >::value && BloombergLP::bslmf::IsAccessibleBaseOf<optional, DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType>::type = BloombergLP::bslstl::optNoSuchType, typename bsl::enable_if< !bsl::is_same< optional , DERIVED >::value, BloombergLP::bslstl::Optional_OptNoSuchType>::type = BloombergLP::bslstl::optNoSuchType) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION( bsl bsl::optional< TYPE, USES_BSLMA_ALLOC >::optional(BSLS_COMPILERFEATURES_FORWARD_REF(ANY_TYPE) value, 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< ANY_TYPE, TYPE >::value, BloombergLP::bslstl::Optional_OptNoSuchType >::type=BloombergLP::bslstl::optNoSuchType) |
< IMPLICIT: Create an optional
object having the same value as the specified original
object by moving the contents of original
to the newly-created object. The allocator associated with original
is propagated for use in the newly-created object. original
is left in a valid, but unspecified state.
< IMPLICIT: Create an optional
object having the same value as the base of the specified original
object by moving the contents of original
to the newly-created object. The allocator associated with original
is propagated for use in the newly-created object. original
is left in a valid, but unspecified state. Note that this constructor does not participate in overload resolution unless optional
is an accessible base class of DERIVED
. Create an optional
object having the specified value
. Use the currently installed default allocator to supply memory.
void swap (optional& other) BSLS_KEYWORD_NOEXCEPT_SPECIFICATION( bsl TYPE& bsl::optional< TYPE, USES_BSLMA_ALLOC >::value() |
< Efficiently exchange the value of this object with the value of the specified other
object. This method provides the no-throw exception-safety guarantee if the template parameter TYPE
provides that guarantee and the result of the hasValue
method for the two objects being swapped is the same. The behavior is undefined unless this object was created with the same allocator as other
. Return a reference providing modifiable access to the underlying TYPE
object. Throws a bsl::bad_optional_access
if the optional
object is disengaged.
Referenced by bsl::optional< bsl::string >::optional().
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, USES_BSLMA_ALLOC >::operator=(const optional< ANY_TYPE > &rhs) [inline] |
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, USES_BSLMA_ALLOC >::operator=(BSLMF_MOVABLEREF_DEDUCE(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.
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, USES_BSLMA_ALLOC >::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.
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, USES_BSLMA_ALLOC >::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.