BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslstl_variant.h File Reference

Go to the source code of this file.

Classes

struct  bsl::variant_size< const t_BSL_VARIANT >
 
struct  bsl::variant_size< volatile t_BSL_VARIANT >
 
struct  bsl::variant_size< const volatile t_BSL_VARIANT >
 
struct  bsl::variant_size< variant< t_HEAD, t_TAIL... > >
 
struct  bsl::variant_alternative< t_INDEX, const t_TYPE >
 
struct  bsl::variant_alternative< t_INDEX, volatile t_TYPE >
 
struct  bsl::variant_alternative< t_INDEX, const volatile t_TYPE >
 
struct  bsl::Variant_VariantAlternativeImpl< t_INDEX, t_HEAD, t_TAIL >
 
struct  bsl::Variant_VariantAlternativeImpl< t_INDEX, BSLSTL_VARIANT_NOT_A_TYPE >
 
struct  bsl::Variant_VariantAlternativeImpl< 0, BSLSTL_VARIANT_NOT_A_TYPE >
 
struct  bsl::Variant_VariantAlternativeImpl< 0, t_HEAD, t_TAIL... >
 
struct  bsl::variant_alternative< t_INDEX, variant< t_HEAD, t_TAIL... > >
 
struct  bsl::Variant_GetIndexReturnTypeImpl< t_VALID, t_INDEX, t_ARG, t_VARIANT >
 
struct  bsl::Variant_GetIndexReturnTypeImpl< true, t_INDEX, t_VARIANT, t_VARIANT >
 
struct  bsl::Variant_GetIndexReturnTypeImpl< true, t_INDEX, const t_VARIANT, t_VARIANT >
 
struct  bsl::Variant_GetIndexReturnTypeImpl< true, t_INDEX, BloombergLP::bslmf::MovableRef< t_VARIANT >, t_VARIANT >
 
struct  bsl::Variant_GetIndexReturnType< t_INDEX, t_ARG, bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bsl::Variant_GetTypeReturnType< t_TYPE, bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bslstl::Variant_ConstructFromStdTag
 
struct  bslstl::Variant_UsesBslmaAllocatorAny< BSLSTL_VARIANT_NOT_A_TYPE >
 
struct  bslstl::Variant_UsesBslmaAllocatorAny< t_HEAD, t_TAIL >
 
struct  bslstl::Variant_IsBitwiseMoveableAll< BSLSTL_VARIANT_NOT_A_TYPE >
 
struct  bslstl::Variant_IsBitwiseMoveableAll< t_HEAD, t_TAIL >
 
struct  bslstl::Variant_IsTag< t_TYPE >
 
struct  bslstl::Variant_IsTag< bsl::allocator_arg_t >
 
struct  bslstl::Variant_IsTag< bsl::in_place_type_t< t_TYPE > >
 
struct  bslstl::Variant_IsTag< bsl::in_place_index_t< t_INDEX > >
 
struct  bslstl::Variant_IsConstructible< t_TO, t_FROM >
 
struct  bslstl::Variant_IsAssignable< t_LHS, t_RHS >
 
struct  bslstl::Variant_TypeToIndexImpl< t_INDEX, t_TYPE, t_HEAD, t_TAIL >
 
struct  bslstl::Variant_TypeToIndexImpl< t_INDEX, t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE >
 
struct  bslstl::Variant_TypeToIndex< t_TYPE, bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bslstl::Variant_CountType< t_TYPE, t_HEAD, t_TAIL >
 
struct  bslstl::Variant_CountType< t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE >
 Specialization for purposes of the sim_cpp11_features.pl script. More...
 
struct  bslstl::Variant_HasUniqueType< t_TYPE, bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bslstl::Variant_CountCVType< t_TYPE, t_HEAD, t_TAIL >
 
struct  bslstl::Variant_CountCVType< t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE >
 Specialization for purposes of the sim_cpp11_features.pl script. More...
 
struct  bslstl::Variant_HasUniqueCVType< t_TYPE, bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bslstl::Variant_CVQualAlt< t_VARIANT, t_INDEX >
 
struct  bslstl::Variant_IsSameReturnType< t_RET, t_VISITOR, t_VARIANT, t_INDEX >
 
struct  bslstl::Variant_IsSameReturnType< t_RET, t_VISITOR, t_VARIANT, 0 >
 
struct  bslstl::Variant_ImpUtil
 
struct  bslstl::Variant_ConvertToIndexImpl< t_INDEX, t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE >
 
struct  bslstl::Variant_ConvertToIndexImpl< t_INDEX, t_TYPE, t_HEAD, t_TAIL... >
 
struct  bslstl::Variant_ConvertIndex< t_TYPE, bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bslstl::Variant_IsAlternativeConstructibleFrom< t_VARIANT, t_TYPE, t_INDEX >
 
struct  bslstl::Variant_IsAlternativeConstructibleFrom< t_VARIANT, t_TYPE, bsl::variant_npos >
 
struct  bslstl::Variant_isAlternativeAssignableFrom< t_VARIANT, t_TYPE, t_INDEX >
 
struct  bslstl::Variant_isAlternativeAssignableFrom< t_VARIANT, t_TYPE, bsl::variant_npos >
 
struct  bslstl::Variant_CorrespondingStdVariant< t_TYPE >
 
struct  bslstl::Variant_ConstructsFromType< t_VARIANT, t_TYPE >
 
struct  bslstl::Variant_AssignsFromType< t_VARIANT, t_TYPE >
 
struct  bslstl::Variant_Function< t_RET, t_VISITOR, t_VARIANT, t_ALT_TYPE >
 
struct  bslstl::Variant_Function< void, t_VISITOR, t_VARIANT, t_ALT_TYPE >
 
struct  bslstl::Variant_MoveFunction< t_RET, t_VISITOR, t_VARIANT, t_ALT_TYPE >
 
struct  bslstl::Variant_MoveFunction< void, t_VISITOR, t_VARIANT, t_ALT_TYPE >
 
struct  bslstl::Variant_FunctionId< t_RET, t_VISITOR, t_VARIANT, t_ALT_TYPE >
 
struct  bslstl::Variant_VTable< t_RET, t_VISITOR, bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bslstl::Variant_VTable< t_RET, t_VISITOR, const bsl::variant< t_HEAD, t_TAIL... > >
 
struct  bslstl::Variant_NoSuchType
 
class  bslstl::Variant_DataImp< t_TYPE >
 
union  bslstl::Variant_Union< void, void >
 
union  bslstl::Variant_Union< BloombergLP::bsls::CompilerFeaturesNilT >
 
union  bslstl::Variant_Union< t_HEAD, t_TAIL0, t_TAIL... >
 
class  bslstl::Variant_CopyConstructVisitor< t_VARIANT_BASE >
 
class  bslstl::Variant_MoveConstructVisitor< t_VARIANT_BASE >
 
class  bslstl::Variant_CopyAssignVisitor< t_VARIANT >
 
class  bslstl::Variant_MoveAssignVisitor< t_VARIANT >
 
struct  bslstl::Variant_DestructorVisitor
 
class  bslstl::Variant_SwapVisitor< t_VARIANT >
 
class  bslstl::Variant_HashVisitor< t_HASHALG >
 
struct  bslstl::Variant_AllocatorBase< t_AA >
 
struct  bslstl::Variant_AllocatorBase< true >
 This specialization is used when the variant is allocator-aware. More...
 
struct  bslstl::Variant_Base< t_HEAD, t_TAIL >
 
struct  bslstl::Variant_Base< t_HEAD, t_TAIL >::NoAlloc
 
class  bsl::variant< t_HEAD, t_TAIL >
 

Macros

#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM(VARIANT, TYPE)
 
#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM(VARIANT, TYPE)
 
#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM_STD(STD_VARIANT)
 
#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM_STD(STD_VARIANT)
 
#define BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE(TYPE)
 
#define BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(TYPE)
 
#define BSLSTL_VARIANT_HAS_UNIQUE_TYPE(TYPE)
 
#define BSLSTL_VARIANT_TYPE_AT_INDEX(INDEX)
 
#define BSLSTL_VARIANT_INDEX_OF(TYPE, VARIANT)    BloombergLP::bslstl::Variant_TypeToIndex<TYPE, VARIANT>::value
 
#define BSLSTL_VARIANT_CONVERT_INDEX_OF(TYPE, VARIANT)    BloombergLP::bslstl::Variant_ConvertIndex<TYPE, VARIANT>::value
 
#define BSLSTL_VARIANT_CONVERT_TYPE_OF(TYPE, VARIANT)
 
#define BSLSTL_VARIANT_VISITID(RET, VISITOR, VAROBJ)    BloombergLP::bslstl::Variant_ImpUtil::visitId<RET>(VISITOR, VAROBJ);
 
#define BSLSTL_VARIANT_RELOP_VISITOR_DEFINITON(NAME, OP)
 

Typedefs

typedef void BSLSTL_VARIANT_NOT_A_TYPE
 

Functions

template<class t_HEAD , class... t_TAIL>
void bsl::swap (bsl::variant< t_HEAD, t_TAIL... > &lhs, bsl::variant< t_HEAD, t_TAIL... > &rhs)
 
template<class t_HASHALG , class t_HEAD , class... t_TAIL>
void bsl::hashAppend (t_HASHALG &hashAlg, const variant< t_HEAD, t_TAIL... > &input)
 
template<class t_TYPE , class t_HEAD , class... t_TAIL>
bool bsl::holds_alternative (const variant< t_HEAD, t_TAIL... > &obj) BSLS_KEYWORD_NOEXCEPT
 
template<size_t t_INDEX, class t_VARIANT >
Variant_GetIndexReturnType< t_INDEX, t_VARIANT >::type bsl::get (t_VARIANT &obj)
 
template<size_t t_INDEX, class t_VARIANT >
Variant_GetIndexReturnType< t_INDEX, BloombergLP::bslmf::MovableRef< t_VARIANT > >::type bsl::get (BloombergLP::bslmf::MovableRef< t_VARIANT > obj)
 
template<class t_TYPE , class t_VARIANT >
Variant_GetTypeReturnType< t_TYPE &, t_VARIANT >::type bsl::get (t_VARIANT &obj)
 
template<class t_TYPE , class t_VARIANT >
Variant_GetTypeReturnType< constt_TYPE &, t_VARIANT >::type bsl::get (const t_VARIANT &obj)
 
template<class t_TYPE , class t_VARIANT >
Variant_GetTypeReturnType< BloombergLP::bslmf::MovableRef< t_TYPE >, t_VARIANT >::type bsl::get (BloombergLP::bslmf::MovableRef< t_VARIANT > obj)
 
template<size_t t_INDEX, class t_VARIANT >
Variant_GetIndexReturnType< t_INDEX, t_VARIANT >::pointer bsl::get_if (t_VARIANT *obj) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE , class t_VARIANT >
Variant_GetTypeReturnType< t_TYPE, t_VARIANT >::pointer bsl::get_if (t_VARIANT *obj) BSLS_KEYWORD_NOEXCEPT
 
template<class t_TYPE , class t_VARIANT >
Variant_GetTypeReturnType< constt_TYPE, t_VARIANT >::pointer bsl::get_if (const t_VARIANT *obj) BSLS_KEYWORD_NOEXCEPT
 
template<class t_HEAD , class... t_TAIL>
bool bsl::operator== (const variant< t_HEAD, t_TAIL... > &lhs, const variant< t_HEAD, t_TAIL... > &rhs)
 
template<class t_HEAD , class... t_TAIL>
bool bsl::operator!= (const variant< t_HEAD, t_TAIL... > &lhs, const variant< t_HEAD, t_TAIL... > &rhs)
 
template<class t_HEAD , class... t_TAIL>
bool bsl::operator< (const variant< t_HEAD, t_TAIL... > &lhs, const variant< t_HEAD, t_TAIL... > &rhs)
 
template<class t_HEAD , class... t_TAIL>
bool bsl::operator> (const variant< t_HEAD, t_TAIL... > &lhs, const variant< t_HEAD, t_TAIL... > &rhs)
 
template<class t_HEAD , class... t_TAIL>
bool bsl::operator<= (const variant< t_HEAD, t_TAIL... > &lhs, const variant< t_HEAD, t_TAIL... > &rhs)
 
template<class t_HEAD , class... t_TAIL>
bool bsl::operator>= (const variant< t_HEAD, t_TAIL... > &lhs, const variant< t_HEAD, t_TAIL... > &rhs)
 
template<class t_RET , class t_VISITOR , class t_VARIANT >
t_RET bsl::visitR (t_VISITOR &visitor, t_VARIANT &variant)
 
template<class t_RET , class t_VISITOR , class t_VARIANT >
t_RET bsl::visitR (t_VISITOR &visitor, BloombergLP::bslmf::MovableRef< t_VARIANT > variant)
 
template<class t_VISITOR , class t_VARIANT >
bsl::invoke_result< t_VISITOR &, typenamebsl::variant_alternative< 0, t_VARIANT >::type & >::type bsl::visit (t_VISITOR &visitor, t_VARIANT &variant)
 
template<class t_VISITOR , class t_VARIANT >
bsl::invoke_result< t_VISITOR &, BloombergLP::bslmf::MovableRef< typenamebsl::variant_alternative< 0, t_VARIANT >::type > >::type bsl::visit (t_VISITOR &visitor, BloombergLP::bslmf::MovableRef< t_VARIANT > variant)
 
template<class t_VARIANT >
void bslstl::variant_swapImpl (bsl::true_type, t_VARIANT &lhs, t_VARIANT &rhs)
 
template<class t_VARIANT >
void bslstl::variant_swapImpl (bsl::false_type, t_VARIANT &lhs, t_VARIANT &rhs)
 

Variables

BSLS_KEYWORD_INLINE_CONSTEXPR size_t bsl::variant_npos = -1
 

Detailed Description

The content of this file has been pre-processed for Doxygen.

Macro Definition Documentation

◆ BSLSTL_VARIANT_CONVERT_INDEX_OF

#define BSLSTL_VARIANT_CONVERT_INDEX_OF (   TYPE,
  VARIANT 
)     BloombergLP::bslstl::Variant_ConvertIndex<TYPE, VARIANT>::value

This component-private macro expands to the index of the first alternative in the specified VARIANT that is a "unique" best match for conversion from std::declval<TYPE>(). See the documentation for Variant_ConvertIndex for more details.

◆ BSLSTL_VARIANT_CONVERT_TYPE_OF

#define BSLSTL_VARIANT_CONVERT_TYPE_OF (   TYPE,
  VARIANT 
)
Value:
TYPE, VARIANT), \
VARIANT>::type
#define BSLSTL_VARIANT_CONVERT_INDEX_OF(TYPE, VARIANT)
Definition bslstl_variant.h:927
Definition bslstl_variant.h:384

This component-private macro expands to the type of the alternative in the specified VARIANT that is a "unique" best match for conversion from std::declval<TYPE>(). See the documentation for Variant_ConvertIndex for more details.

◆ BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM

#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM (   VARIANT,
  TYPE 
)
Value:
VARIANT, \
TYPE) = BloombergLP::bslstl::Variant_NoSuchType(0)
#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM(VARIANT, TYPE)
Definition bslstl_variant.h:857

This component-private macro is used as a constraint in function declarations which require the specified VARIANT to be constructible from the specified TYPE.

◆ BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM_STD

#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM_STD (   STD_VARIANT)
Value:
= BloombergLP::bslstl::Variant_NoSuchType(0)
#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM_STD(STD_VARIANT)
Definition bslstl_variant.h:873

This component-private macro is used as a constraintwhen declaring constructors of variant from the corresponding std::variant.

◆ BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE

#define BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE (   TYPE)
Value:
TYPE) = BloombergLP::bslstl::Variant_NoSuchType(0)
#define BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE(TYPE)
Definition bslstl_variant.h:890

This component-private macro is used as a constraint in function declarations which require the specified TYPE to be a unique alternative in variant<t_HEAD, t_TAIL...>.

◆ BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM

#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM (   VARIANT,
  TYPE 
)
Value:
typename bsl::enable_if< \
BloombergLP::bslstl::Variant_ConstructsFromType<VARIANT, \
TYPE>::value, \
BloombergLP::bslstl::Variant_NoSuchType>::type
Definition bslmf_enableif.h:525

This component-private macro is used as a constraint in function definitions which require the specified VARIANT to be constructible from the specified TYPE.

◆ BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM_STD

#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM_STD (   STD_VARIANT)
Value:
bsl::enable_if_t< \
BloombergLP::bslstl::variant_constructsFromStd<variant, STD_VARIANT>, \
BloombergLP::bslstl::Variant_NoSuchType>

This component-private macro is used as a constraint when defining constructors of variant from the corresponding std::variant.

◆ BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE

#define BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE (   TYPE)
Value:
typename bsl::enable_if< \
BloombergLP::bslstl::Variant_HasUniqueType<TYPE, variant>::value, \
BloombergLP::bslstl::Variant_NoSuchType>::type

This component-private macro is used as a constraint in function definitions which require the specified TYPE to be a unique alternative in variant<t_HEAD, t_TAIL...>. Implementation note: This macro can't use BSLSTL_VARIANT_HAS_UNIQUE_TYPE because this macro is used at points where variant<t_HEAD, t_TAIL...> expands to an invalid construct.

◆ BSLSTL_VARIANT_HAS_UNIQUE_TYPE

#define BSLSTL_VARIANT_HAS_UNIQUE_TYPE (   TYPE)
Value:
BloombergLP::bslstl:: \
Variant_HasUniqueType<TYPE, variant<t_HEAD, t_TAIL...> >::value

This component-private macro expands to the check for whether the specified TYPE is a unique alternative in variant<t_HEAD, t_TAIL...>. See definition Variant_HasUniqueType for more details.

◆ BSLSTL_VARIANT_INDEX_OF

#define BSLSTL_VARIANT_INDEX_OF (   TYPE,
  VARIANT 
)     BloombergLP::bslstl::Variant_TypeToIndex<TYPE, VARIANT>::value

This component-private macro expands to the index of the first alternative in the specified VARIANT that is identical to the specified TYPE, or bsl::variant_npos if no such alternative exists.

◆ BSLSTL_VARIANT_RELOP_VISITOR_DEFINITON

#define BSLSTL_VARIANT_RELOP_VISITOR_DEFINITON (   NAME,
  OP 
)

◆ BSLSTL_VARIANT_TYPE_AT_INDEX

#define BSLSTL_VARIANT_TYPE_AT_INDEX (   INDEX)
Value:
typename bsl::variant_alternative<INDEX, \
bsl::variant<t_HEAD, t_TAIL...> >::type
Definition bslstl_variant.h:3685

This component-private macro expands to the type of alternative at specified INDEX for a variant of type bsl::variant<t_HEAD, t_TAIL...>.

◆ BSLSTL_VARIANT_VISITID

#define BSLSTL_VARIANT_VISITID (   RET,
  VISITOR,
  VAROBJ 
)     BloombergLP::bslstl::Variant_ImpUtil::visitId<RET>(VISITOR, VAROBJ);

This component-private macro expands to the invocation of Variant_ImpUtil::visitId with specified RET as return type, and specified VISITOR and specified VAROBJ as arguments. See the documentation of Variant_ImpUtil::visitId for more details.