Quick Links:

bal | bbl | bdl | bsl

Classes | Namespaces | Defines | Functions | Variables

bslstl_optional.h File Reference

Provide a standard-compliant allocator aware optional type. More...

Go to the source code of this file.

Classes

struct  bslstl::Optional_IsTriviallyDestructible< TYPE >
struct  bslstl::Optional_OptNoSuchType
struct  bslstl::Optional_PropagatesAllocator< TYPE, ANY_TYPE >
struct  bslstl::Optional_ConstructsFromType< TYPE, ANY_TYPE >
struct  bslstl::Optional_DataImp< TYPE >
struct  bslstl::Optional_Data< TYPE, IS_TRIVIALLY_DESTRUCTIBLE >
struct  bslstl::Optional_Data< TYPE, true >
class  bsl::optional< TYPE, USES_BSLMA_ALLOC >
class  bsl::optional< TYPE, false >
struct  bslma::UsesBslmaAllocator< bsl::optional< TYPE, false > >

Namespaces

namespace  bsl
namespace  bslstl
namespace  bslma

Defines

#define BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(U, V, DEFAULT)   std::is_constructible<U, V>::value
#define BSLSTL_OPTIONAL_IS_ASSIGNABLE(U, V, DEFAULT)   std::is_assignable<U, V>::value
#define BSLSTL_OPTIONAL_CONVERTS_FROM(TYPE, OPT_TYPE)
#define BSLSTL_OPTIONAL_ASSIGNS_FROM(TYPE, OPT_TYPE)
#define BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE,ANY_TYPE)
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL(TYPE,ANY_TYPE)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE,ANY_TYPE)
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL(TYPE,ANY_TYPE)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE,ANY_TYPE)
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR(TYPE,ANY_TYPE)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM(TYPE, ANYTYPE)
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM(TYPE, ANYTYPE)
#define BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL(DERIVED)
#define BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL(DERIVED)
#define BSLSTL_OPTIONAL_DEFINE_IF_SAME(U, V)
#define BSLSTL_OPTIONAL_DECLARE_IF_SAME(U, V)   BSLSTL_OPTIONAL_DEFINE_IF_SAME(U, V) = BloombergLP::bslstl::optNoSuchType
#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_SAME(U, V)
#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_SAME(U, V)
#define BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT(U, V)
#define BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT(U, V)
#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT(U, V)
#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT(U, V)
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED(TYPE, DERIVED)
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_FORWARD_REF(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE(TYPE, ANY_TYPE)
#define BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG(ARG)

Functions

template<class TYPE >
bsl::enable_if
< BloombergLP::bslma::UsesBslmaAllocator
< TYPE >::value, void >::type 
bsl::swap (bsl::optional< TYPE > &lhs, bsl::optional< TYPE > &rhs)
template<class HASHALG , class TYPE >
void bsl::hashAppend (HASHALG &hashAlg, const optional< TYPE > &input)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator== (const bsl::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator!= (const bsl::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator< (const bsl::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator> (const bsl::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator<= (const bsl::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator>= (const bsl::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator== (const bsl::optional< TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator== (const bsl::nullopt_t &, const bsl::optional< TYPE > &value) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator!= (const bsl::optional< TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator!= (const bsl::nullopt_t &, const bsl::optional< TYPE > &value) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator< (const bsl::optional< TYPE > &, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator< (const bsl::nullopt_t &, const bsl::optional< TYPE > &value) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator> (const bsl::optional< TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator> (const bsl::nullopt_t &, const bsl::optional< TYPE > &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator<= (const bsl::optional< TYPE > &value, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator<= (const bsl::nullopt_t &, const bsl::optional< TYPE > &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator>= (const bsl::optional< TYPE > &, const bsl::nullopt_t &) BSLS_KEYWORD_NOEXCEPT
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR bool bsl::operator>= (const bsl::nullopt_t &, const bsl::optional< TYPE > &value) BSLS_KEYWORD_NOEXCEPT
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator!= (const bsl::optional< LHS_TYPE > &lhs, const RHS_TYPE &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator!= (const LHS_TYPE &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator== (const bsl::optional< LHS_TYPE > &lhs, const RHS_TYPE &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator== (const LHS_TYPE &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator< (const bsl::optional< LHS_TYPE > &lhs, const RHS_TYPE &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator< (const LHS_TYPE &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator> (const bsl::optional< LHS_TYPE > &lhs, const RHS_TYPE &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator> (const LHS_TYPE &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator<= (const bsl::optional< LHS_TYPE > &lhs, const RHS_TYPE &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator<= (const LHS_TYPE &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator>= (const bsl::optional< LHS_TYPE > &lhs, const RHS_TYPE &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator>= (const LHS_TYPE &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class TYPE >
bsl::enable_if
<!BloombergLP::bslma::UsesBslmaAllocator
< TYPE >::value, void >::type 
bsl::swap (bsl::optional< TYPE > &lhs, std::optional< TYPE > &rhs)
template<class TYPE >
bsl::enable_if
<!BloombergLP::bslma::UsesBslmaAllocator
< TYPE >::value, void >::type 
bsl::swap (std::optional< TYPE > &lhs, bsl::optional< TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator== (const std::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator== (const bsl::optional< LHS_TYPE > &lhs, const std::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator!= (const bsl::optional< LHS_TYPE > &lhs, const std::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator!= (const std::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator< (const bsl::optional< LHS_TYPE > &lhs, const std::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator< (const std::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator> (const bsl::optional< LHS_TYPE > &lhs, const std::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator> (const std::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator<= (const bsl::optional< LHS_TYPE > &lhs, const std::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator<= (const std::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator>= (const bsl::optional< LHS_TYPE > &lhs, const std::optional< RHS_TYPE > &rhs)
template<class LHS_TYPE , class RHS_TYPE >
bool bsl::operator>= (const std::optional< LHS_TYPE > &lhs, const bsl::optional< RHS_TYPE > &rhs)
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR
bsl::optional< typename
bsl::decay< TYPE >::type
bsl::make_optional (bsl::allocator_arg_t, typename bsl::optional< typename bsl::decay< TYPE >::type >::allocator_type const &, BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs)
template<class TYPE , class... ARGS>
BSLS_KEYWORD_CONSTEXPR
bsl::optional< TYPE > 
bsl::make_optional (bsl::allocator_arg_t, typename bsl::optional< TYPE >::allocator_type const &alloc, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...args)
template<class TYPE , class INIT_LIST_TYPE , class... ARGS>
BSLS_KEYWORD_CONSTEXPR
bsl::optional< TYPE > 
bsl::make_optional (bsl::allocator_arg_t, typename bsl::optional< TYPE >::allocator_type const &alloc, std::initializer_list< INIT_LIST_TYPE > il, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...args)
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR
bsl::optional< typename
bsl::decay< TYPE >::type
bsl::make_optional (BSLS_COMPILERFEATURES_FORWARD_REF(TYPE) rhs)
template<class TYPE >
BSLS_KEYWORD_CONSTEXPR
bsl::optional< TYPE > 
bsl::make_optional ()
template<class TYPE , class ARG , class... ARGS>
BSLS_KEYWORD_CONSTEXPR
bsl::enable_if< !bsl::is_same
< typename bsl::remove_cvref
< ARG >::type,
bsl::allocator_arg_t >::value,
optional< TYPE > >::type 
bsl::make_optional (BSLS_COMPILERFEATURES_FORWARD_REF(ARG), BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...)
template<class TYPE , class INIT_LIST_TYPE , class... ARGS>
BSLS_KEYWORD_CONSTEXPR
bsl::optional< TYPE > 
bsl::make_optional (std::initializer_list< INIT_LIST_TYPE > il, BSLS_COMPILERFEATURES_FORWARD_REF(ARGS)...args)

Variables

const Optional_OptNoSuchType bslstl::optNoSuchType

Detailed Description


Define Documentation

#define BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE (   U,
  V,
  DEFAULT 
)    std::is_constructible<U, V>::value
#define BSLSTL_OPTIONAL_IS_ASSIGNABLE (   U,
  V,
  DEFAULT 
)    std::is_assignable<U, V>::value
#define BSLSTL_OPTIONAL_CONVERTS_FROM (   TYPE,
  OPT_TYPE 
)
#define BSLSTL_OPTIONAL_ASSIGNS_FROM (   TYPE,
  OPT_TYPE 
)
Value:
(std::is_assignable<TYPE&, const OPT_TYPE&>::value ||                     \
     std::is_assignable<TYPE&, OPT_TYPE&>::value ||                           \
     std::is_assignable<TYPE&, const OPT_TYPE>::value ||                      \
     std::is_assignable<TYPE&, OPT_TYPE>::value)
#define BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL (   TYPE,
  ANY_TYPE 
)
#define BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL (   TYPE,
  ANY_TYPE 
)
#define BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL (   TYPE,
  ANY_TYPE 
)
Value:
#define BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL (   TYPE,
  ANY_TYPE 
)
Value:
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL (   TYPE,
  ANY_TYPE 
)
Value:
typename bsl::enable_if<                                                  \
        !BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) &&        \
            BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true),           \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_BSL_OPTIONAL (   TYPE,
  ANY_TYPE 
)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM_STD_OPTIONAL (   TYPE,
  ANY_TYPE 
)
Value:
typename bsl::enable_if<                                                  \
        !BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) &&        \
            BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true),           \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM_STD_OPTIONAL (   TYPE,
  ANY_TYPE 
)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR (   TYPE,
  ANY_TYPE 
)
Value:
typename bsl::enable_if<                                                  \
        BloombergLP::bslstl::Optional_PropagatesAllocator<TYPE,               \
                                                          ANY_TYPE>::value,   \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_PROPAGATES_ALLOCATOR (   TYPE,
  ANY_TYPE 
)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR (   TYPE,
  ANY_TYPE 
)
Value:
typename bsl::enable_if<                                                  \
        !BloombergLP::bslstl::Optional_PropagatesAllocator<TYPE,              \
                                                           ANY_TYPE>::value,  \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCT_DOES_NOT_PROPAGATE_ALLOCATOR (   TYPE,
  ANY_TYPE 
)
#define BSLSTL_OPTIONAL_DEFINE_IF_CONSTRUCTS_FROM (   TYPE,
  ANYTYPE 
)
Value:
typename bsl::enable_if<                                                  \
        BloombergLP::bslstl::Optional_ConstructsFromType<TYPE,                \
                                                         ANY_TYPE>::value,    \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_CONSTRUCTS_FROM (   TYPE,
  ANYTYPE 
)
#define BSLSTL_OPTIONAL_DEFINE_IF_DERIVED_FROM_OPTIONAL (   DERIVED  ) 
Value:
typename bsl::enable_if<                                                \
        !bsl::is_same<optional, DERIVED>::value &&                            \
        BloombergLP::bslmf::IsAccessibleBaseOf<optional,                      \
                                               DERIVED>::value,               \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_DERIVED_FROM_OPTIONAL (   DERIVED  ) 
#define BSLSTL_OPTIONAL_DEFINE_IF_SAME (   U,
  V 
)
Value:
typename bsl::enable_if<                                                  \
        bsl::is_same<U, V>::value,                                            \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_SAME (   U,
  V 
)    BSLSTL_OPTIONAL_DEFINE_IF_SAME(U, V) = BloombergLP::bslstl::optNoSuchType
#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_SAME (   U,
  V 
)
Value:
typename bsl::enable_if<                                                  \
        !bsl::is_same<U, V>::value,                                           \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_SAME (   U,
  V 
)
#define BSLSTL_OPTIONAL_DEFINE_IF_EXPLICIT_CONSTRUCT (   U,
  V 
)
Value:
typename bsl::enable_if<                                                  \
        !bsl::is_convertible<V, U>::value,                                    \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_EXPLICIT_CONSTRUCT (   U,
  V 
)
#define BSLSTL_OPTIONAL_DEFINE_IF_NOT_EXPLICIT_CONSTRUCT (   U,
  V 
)
Value:
typename bsl::enable_if<                                                  \
        bsl::is_convertible<V, U>::value,                                     \
        BloombergLP::bslstl::Optional_OptNoSuchType>::type
#define BSLSTL_OPTIONAL_DECLARE_IF_NOT_EXPLICIT_CONSTRUCT (   U,
  V 
)
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_BSL_OPTIONAL (   TYPE,
  ANY_TYPE 
)
Value:
typename bsl::enable_if<                                                  \
        !BSLSTL_OPTIONAL_CONVERTS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE) &&        \
            BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true) &&         \
            BSLSTL_OPTIONAL_IS_ASSIGNABLE(TYPE&, ANY_TYPE, true) &&           \
            !BSLSTL_OPTIONAL_ASSIGNS_FROM_BSL_OPTIONAL(TYPE, ANY_TYPE),       \
        optional<TYPE> >::type
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_STD_OPTIONAL (   TYPE,
  ANY_TYPE 
)
Value:
typename bsl::enable_if<                                                  \
        !BSLSTL_OPTIONAL_CONVERTS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE) &&        \
            BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true) &&         \
            BSLSTL_OPTIONAL_IS_ASSIGNABLE(TYPE&, ANY_TYPE, true) &&           \
            !BSLSTL_OPTIONAL_ASSIGNS_FROM_STD_OPTIONAL(TYPE, ANY_TYPE),       \
        optional<TYPE> >::type
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_DERIVED (   TYPE,
  DERIVED 
)
Value:
typename bsl::enable_if<                                                \
        BloombergLP::bslmf::IsAccessibleBaseOf<bsl::optional<TYPE>,           \
                                               DERIVED>::value &&             \
        !bsl::is_same<bsl::optional<TYPE>, DERIVED>::value,                   \
        optional<TYPE> >::type
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_FORWARD_REF (   TYPE,
  ANY_TYPE 
)
Value:
typename 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) &&                                 \
            BSLSTL_OPTIONAL_IS_CONSTRUCTIBLE(TYPE, ANY_TYPE, true) &&         \
            BSLSTL_OPTIONAL_IS_ASSIGNABLE(TYPE&, ANY_TYPE, true),             \
        optional<TYPE> >::type
#define BSLSTL_OPTIONAL_ENABLE_ASSIGN_FROM_ANY_TYPE (   TYPE,
  ANY_TYPE 
)
Value:
typename 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
#define BSLSTL_OPTIONAL_ENABLE_IF_NOT_ALLOCATOR_TAG (   ARG  ) 
Value:
typename bsl::enable_if<                                                  \
        !bsl::is_same<                                                        \
            typename bsl::remove_cvref<ARG>::type,                            \
            bsl::allocator_arg_t>::value,                                     \
        optional<TYPE> >::type