9#ifndef INCLUDED_BSLSTL_VARIANT
10#define INCLUDED_BSLSTL_VARIANT
232#include <bslscm_version.h>
277#ifdef BSLS_COMPILERFEATURES_SUPPORT_DECLTYPE
278#ifdef BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS
279#ifdef BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
280#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
283#ifdef BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
284#define BSL_VARIANT_FULL_IMPLEMENTATION
291#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
292#include <type_traits>
296#ifdef BSLS_COMPILERFEATURES_SUPPORT_GENERALIZED_INITIALIZERS
297#include <initializer_list>
300#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
304#if BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
308# define COMPILING_BSLSTL_VARIANT_H
310# undef COMPILING_BSLSTL_VARIANT_H
326#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
327template <
class t_HEAD,
class... t_TAIL>
340template <
class t_BSL_VARIANT>
343template <
class t_BSL_VARIANT>
347template <
class t_BSL_VARIANT>
351template <
class t_BSL_VARIANT>
356#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
357template <
class t_HEAD,
class... t_TAIL>
363#ifdef BSLS_COMPILERFEATURES_SUPPORT_VARIABLE_TEMPLATES
366template <
class t_BSL_VARIANT>
383template <
size_t t_INDEX,
class t_TYPE>
386template <
size_t t_INDEX,
class t_TYPE>
391template <
size_t t_INDEX,
class t_TYPE>
396template <
size_t t_INDEX,
class t_TYPE>
402#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
408template <
size_t t_INDEX,
415template <
size_t t_INDEX>
423template <
class t_HEAD,
class... t_TAIL>
428template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
435#ifdef BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES
436template <
size_t t_INDEX,
class t_TYPE>
437using variant_alternative_t =
457template <
class t_HEAD,
class... t_TAIL>
465template <
class t_HASHALG,
class t_HEAD,
class... t_TAIL>
473template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
477#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
483template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
486template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
489template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
492template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
494 variant<t_HEAD, t_TAIL...> >::type&&
502template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
504template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
506template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
508template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
511template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
514 variant<t_HEAD, t_TAIL...> >::type>::type
522template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
525 variant<t_HEAD, t_TAIL...> >::type>::type
528template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
537template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
543template <
bool t_VALID,
size_t t_INDEX,
class t_ARG,
class t_VARIANT>
554template <
size_t t_INDEX,
class t_VARIANT>
562template <
size_t t_INDEX,
class t_VARIANT>
574template <
size_t t_INDEX,
class t_VARIANT>
580 typedef BloombergLP::bslmf::MovableRef<
585template <
size_t t_INDEX,
587 class t_VARIANT =
typename BloombergLP::bslmf::MovableRefUtil::
597#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
598template <
size_t t_INDEX,
class t_ARG,
class t_HEAD,
class... t_TAIL>
605 bsl::variant<t_HEAD, t_TAIL...> > {
608template <class t_TYPE, class t_HEAD, class... t_TAIL>
609struct Variant_GetTypeReturnType;
616template <class t_TYPE, class t_HEAD, class... t_TAIL>
617struct Variant_GetTypeReturnType<t_TYPE, bsl::variant<t_HEAD, t_TAIL...> > {
623 typedef typename add_pointer<t_TYPE>::type pointer;
627template <size_t t_INDEX, class t_VARIANT>
628typename Variant_GetIndexReturnType<t_INDEX, t_VARIANT>::type
630template <size_t t_INDEX, class t_VARIANT>
631typename Variant_GetIndexReturnType<
633 BloombergLP::bslmf::MovableRef<t_VARIANT> >::type
634get(BloombergLP::bslmf::MovableRef<t_VARIANT> obj);
641template <class t_TYPE, class t_VARIANT>
642typename Variant_GetTypeReturnType<t_TYPE&, t_VARIANT>::type get(
644template <class t_TYPE, class t_VARIANT>
645typename Variant_GetTypeReturnType<const t_TYPE&, t_VARIANT>::type get(
646 const t_VARIANT& obj);
647template <class t_TYPE, class t_VARIANT>
648typename Variant_GetTypeReturnType<BloombergLP::bslmf::MovableRef<t_TYPE>,
649 t_VARIANT>::type get(
650 BloombergLP::bslmf::MovableRef<t_VARIANT> obj);
657template <size_t t_INDEX, class t_VARIANT>
658typename Variant_GetIndexReturnType<t_INDEX, t_VARIANT>::pointer
659get_if(t_VARIANT *obj) BSLS_KEYWORD_NOEXCEPT;
666template <class t_TYPE, class t_VARIANT>
667typename Variant_GetTypeReturnType<t_TYPE, t_VARIANT>::pointer get_if(
668 t_VARIANT *obj) BSLS_KEYWORD_NOEXCEPT;
669template <class t_TYPE, class t_VARIANT>
670typename Variant_GetTypeReturnType<const t_TYPE, t_VARIANT>::pointer get_if(
671 const t_VARIANT *obj) BSLS_KEYWORD_NOEXCEPT;
681#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
686template <class t_HEAD, class... t_TAIL>
687bool operator==(const variant<t_HEAD, t_TAIL...>& lhs,
688 const variant<t_HEAD, t_TAIL...>& rhs);
694template <class t_HEAD, class... t_TAIL>
695bool operator!=(const variant<t_HEAD, t_TAIL...>& lhs,
696 const variant<t_HEAD, t_TAIL...>& rhs);
703template <class t_HEAD, class... t_TAIL>
704bool operator<(const variant<t_HEAD, t_TAIL...>& lhs,
705 const variant<t_HEAD, t_TAIL...>& rhs);
713template <class t_HEAD, class... t_TAIL>
714bool operator>(const variant<t_HEAD, t_TAIL...>& lhs,
715 const variant<t_HEAD, t_TAIL...>& rhs);
722template <class t_HEAD, class... t_TAIL>
723bool operator<=(const variant<t_HEAD, t_TAIL...>& lhs,
724 const variant<t_HEAD, t_TAIL...>& rhs);
732template <class t_HEAD, class... t_TAIL>
733bool operator>=(const variant<t_HEAD, t_TAIL...>& lhs,
734 const variant<t_HEAD, t_TAIL...>& rhs);
736#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && \
737 defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
746template <class... t_ALTS>
747 requires(std::three_way_comparable<t_ALTS> && ...)
748constexpr std::common_comparison_category_t<
749 std::compare_three_way_result_t<t_ALTS>...>
750operator<=>(const variant<t_ALTS...>& lhs, const variant<t_ALTS...>& rhs);
762struct Variant_ConstructFromStdTag {};
764#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
768template <class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE, class... t_TAIL>
769struct Variant_UsesBslmaAllocatorAny;
772struct Variant_UsesBslmaAllocatorAny<BSLSTL_VARIANT_NOT_A_TYPE>
776template <class t_HEAD, class... t_TAIL>
777struct Variant_UsesBslmaAllocatorAny
778: bsl::integral_constant<
780 BloombergLP::bslma::UsesBslmaAllocator<t_HEAD>::value ||
781 BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny<
788template <class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE, class... t_TAIL>
789struct Variant_IsBitwiseMoveableAll;
792struct Variant_IsBitwiseMoveableAll<BSLSTL_VARIANT_NOT_A_TYPE>
796template <class t_HEAD, class... t_TAIL>
797struct Variant_IsBitwiseMoveableAll
798: bsl::integral_constant<
800 BloombergLP::bslmf::IsBitwiseMoveable<t_HEAD>::value &&
801 Variant_IsBitwiseMoveableAll<t_TAIL...>::value> {
808template <class t_TYPE>
809struct Variant_IsTag : bsl::false_type {
813struct Variant_IsTag<bsl::allocator_arg_t> : bsl::true_type {
816template <class t_TYPE>
817struct Variant_IsTag<bsl::in_place_type_t<t_TYPE> > : bsl::true_type {
820template <size_t t_INDEX>
821struct Variant_IsTag<bsl::in_place_index_t<t_INDEX> > : bsl::true_type {
824#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
828template <class t_TO, class t_FROM>
829struct Variant_IsConstructible : std::is_constructible<t_TO, t_FROM> {
835template <class t_LHS, class t_RHS>
836struct Variant_IsAssignable : std::is_assignable<t_LHS, t_RHS> {
839template <class t_TO, class t_FROM>
840struct Variant_IsConstructible : bsl::true_type {
846template <class t_LHS, class t_RHS>
847struct Variant_IsAssignable : bsl::true_type {
857#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM(VARIANT, TYPE) \
858 typename bsl::enable_if< \
859 BloombergLP::bslstl::Variant_ConstructsFromType<VARIANT, \
861 BloombergLP::bslstl::Variant_NoSuchType>::type
866#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM(VARIANT, TYPE) \
867 BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM( \
869 TYPE) = BloombergLP::bslstl::Variant_NoSuchType(0)
873#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM_STD(STD_VARIANT) \
875 BloombergLP::bslstl::variant_constructsFromStd<variant, STD_VARIANT>, \
876 BloombergLP::bslstl::Variant_NoSuchType>
880#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM_STD(STD_VARIANT) \
881 BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM_STD(STD_VARIANT) \
882 = BloombergLP::bslstl::Variant_NoSuchType(0)
890#define BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE(TYPE) \
891 typename bsl::enable_if< \
892 BloombergLP::bslstl::Variant_HasUniqueType<TYPE, variant>::value, \
893 BloombergLP::bslstl::Variant_NoSuchType>::type
898#define BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(TYPE) \
899 BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE( \
900 TYPE) = BloombergLP::bslstl::Variant_NoSuchType(0)
906#define BSLSTL_VARIANT_HAS_UNIQUE_TYPE(TYPE) \
907 BloombergLP::bslstl:: \
908 Variant_HasUniqueType<TYPE, variant<t_HEAD, t_TAIL...> >::value
913#define BSLSTL_VARIANT_TYPE_AT_INDEX(INDEX) \
914 typename bsl::variant_alternative<INDEX, \
915 bsl::variant<t_HEAD, t_TAIL...> >::type
920#define BSLSTL_VARIANT_INDEX_OF(TYPE, VARIANT) \
921 BloombergLP::bslstl::Variant_TypeToIndex<TYPE, VARIANT>::value
927#define BSLSTL_VARIANT_CONVERT_INDEX_OF(TYPE, VARIANT) \
928 BloombergLP::bslstl::Variant_ConvertIndex<TYPE, VARIANT>::value
934#define BSLSTL_VARIANT_CONVERT_TYPE_OF(TYPE, VARIANT) \
935 typename bsl::variant_alternative<BSLSTL_VARIANT_CONVERT_INDEX_OF( \
943#define BSLSTL_VARIANT_VISITID(RET, VISITOR, VAROBJ) \
944 BloombergLP::bslstl::Variant_ImpUtil::visitId<RET>(VISITOR, VAROBJ);
950template <size_t t_INDEX,
952 class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE,
954struct Variant_TypeToIndexImpl
956 bsl::is_same<t_TYPE, t_HEAD>::value,
957 bsl::integral_constant<size_t, t_INDEX>,
958 Variant_TypeToIndexImpl<t_INDEX + 1, t_TYPE, t_TAIL...> >::type {
964template <size_t t_INDEX, class t_TYPE>
965struct Variant_TypeToIndexImpl<t_INDEX, t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE>
966: bsl::integral_constant<size_t, bsl::variant_npos> {
974template <class t_TYPE, class t_VARIANT>
975struct Variant_TypeToIndex;
977template <class t_TYPE, class t_HEAD, class... t_TAIL>
978struct Variant_TypeToIndex<t_TYPE, bsl::variant<t_HEAD, t_TAIL...> >
979: Variant_TypeToIndexImpl<0, t_TYPE, t_HEAD, t_TAIL...> {
986template <class t_TYPE,
987 class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE,
989struct Variant_CountType
990: bsl::integral_constant<size_t,
991 bsl::is_same<t_TYPE, t_HEAD>::value +
992 Variant_CountType<t_TYPE, t_TAIL...>::value> {
996template <class t_TYPE>
997struct Variant_CountType<t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE>
998: bsl::integral_constant<size_t, 0> {
1007template <class t_TYPE, class t_VARIANT>
1008struct Variant_HasUniqueType;
1010template <class t_TYPE, class t_HEAD, class... t_TAIL>
1011struct Variant_HasUniqueType<t_TYPE, bsl::variant<t_HEAD, t_TAIL...> >
1012: bsl::integral_constant<bool,
1013 Variant_CountType<t_TYPE, t_HEAD, t_TAIL...>::value ==
1021template <class t_TYPE,
1022 class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE,
1024struct Variant_CountCVType
1025: bsl::integral_constant<
1027 bsl::is_same<typename bsl::remove_cv<t_TYPE>::type,
1028 typename bsl::remove_cv<t_HEAD>::type>::value +
1029 Variant_CountCVType<t_TYPE, t_TAIL...>::value> {
1033template <class t_TYPE>
1034struct Variant_CountCVType<t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE>
1035: bsl::integral_constant<size_t, 0> {
1044template <class t_TYPE, class t_VARIANT>
1045struct Variant_HasUniqueCVType;
1047template <class t_TYPE, class t_HEAD, class... t_TAIL>
1048struct Variant_HasUniqueCVType<t_TYPE, bsl::variant<t_HEAD, t_TAIL...> >
1049: bsl::integral_constant<
1051 Variant_CountCVType<t_TYPE, t_HEAD, t_TAIL...>::value == 1> {
1060template <class t_VARIANT, size_t t_INDEX>
1061struct Variant_CVQualAlt {
1064 typedef typename bsl::variant_alternative<
1066 typename bslmf::MovableRefUtil::RemoveReference<t_VARIANT>::type>::type
1069 typedef typename bsl::conditional<
1070 bslmf::MovableRefUtil::IsReference<t_VARIANT>::value,
1071 typename bsl::conditional<
1072 bslmf::MovableRefUtil::IsMovableReference<t_VARIANT>::value,
1073 typename bslmf::MovableRefUtil::AddMovableReference<CVAlt>::type,
1074 typename bslmf::MovableRefUtil::AddLvalueReference<CVAlt>::type>::
1087template <class t_RET,
1091 bsl::variant_size<typename bslmf::MovableRefUtil::
1092 RemoveReference<t_VARIANT>::type>::value -
1094struct Variant_IsSameReturnType
1095: public bsl::integral_constant<
1098 typename bsl::invoke_result<
1100 typename Variant_CVQualAlt<t_VARIANT, t_INDEX>::type>::
1102 Variant_IsSameReturnType<t_RET, t_VISITOR, t_VARIANT, t_INDEX - 1>::
1105template <class t_RET, class t_VISITOR, class t_VARIANT>
1106struct Variant_IsSameReturnType<t_RET, t_VISITOR, t_VARIANT, 0>
1107: bsl::is_same<t_RET,
1108 typename bsl::invoke_result<
1110 typename Variant_CVQualAlt<t_VARIANT, 0>::type>::type> {
1119struct Variant_ImpUtil {
1126 template <class t_RET, size_t t_INDEX, class t_VARIANT>
1127 static t_RET& get(t_VARIANT& variant);
1128 template <class t_RET, size_t t_INDEX, class t_VARIANT>
1129 static t_RET& get(const t_VARIANT& variant);
1131#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
1139 template <class t_RET, class t_VISITOR, class t_VARIANT>
1140 static t_RET visit(t_VISITOR&& visitor, t_VARIANT&& variant);
1151 template <class t_RET, class t_VISITOR, class t_VARIANT>
1152 static t_RET visitId(t_VISITOR&& visitor, t_VARIANT&& variant);
1156 template <class t_RET, class t_VISITOR, class t_VARIANT>
1157 static t_RET visit(t_VISITOR& visitor, t_VARIANT& variant);
1158 template <class t_RET, class t_VISITOR, class t_VARIANT>
1159 static t_RET visit(t_VISITOR& visitor, const t_VARIANT& variant);
1167 template <class t_RET, class t_VISITOR, class t_VARIANT>
1168 static t_RET moveVisit(t_VISITOR& visitor, t_VARIANT& variant);
1177 template <class t_RET, class t_VISITOR, class t_VARIANT>
1178 static t_RET visitId(t_VISITOR& visitor, t_VARIANT& variant);
1179 template <class t_RET, class t_VISITOR, class t_VARIANT>
1180 static t_RET visitId(t_VISITOR& visitor, const t_VARIANT& variant);
1193#ifndef BSL_VARIANT_FULL_IMPLEMENTATION
1203 template <class t_RET, size_t t_INDEX, class t_VARIANT>
1204 static t_RET& unsafeGet(t_VARIANT& variant);
1205 template <class t_RET, size_t t_INDEX, class t_VARIANT>
1206 static t_RET& unsafeGet(const t_VARIANT& variant);
1214 template <class t_TYPE, class t_VARIANT>
1215 static t_TYPE& unsafeGet(t_VARIANT& obj);
1216 template <class t_TYPE, class t_VARIANT>
1217 static const t_TYPE& unsafeGet(const t_VARIANT& obj);
1233 template <class t_RET, class t_VARIANT_UNION>
1234 static t_RET& getAlternative(
1235 bsl::in_place_index_t<0>,
1236 t_VARIANT_UNION& variantUnion) BSLS_KEYWORD_NOEXCEPT;
1247 template <class t_RET, size_t t_INDEX, class t_VARIANT_UNION>
1248 static t_RET& getAlternative(
1249 bsl::in_place_index_t<t_INDEX>,
1250 t_VARIANT_UNION& variantUnion) BSLS_KEYWORD_NOEXCEPT;
1252 template <class t_VARIANT>
1253 static bool Equal(const t_VARIANT& lhs, const t_VARIANT& rhs);
1254 template <class t_VARIANT>
1255 static bool NotEqual(const t_VARIANT& lhs, const t_VARIANT& rhs);
1256 template <class t_VARIANT>
1257 static bool LessThan(const t_VARIANT& lhs, const t_VARIANT& rhs);
1258 template <class t_VARIANT>
1259 static bool GreaterThan(const t_VARIANT& lhs, const t_VARIANT& rhs);
1260 template <class t_VARIANT>
1261 static bool LessOrEqual(const t_VARIANT& lhs, const t_VARIANT& rhs);
1268 template <class t_VARIANT>
1269 static bool GreaterOrEqual(const t_VARIANT& lhs, const t_VARIANT& rhs);
1271#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1274 template <class t_VARIANT, class t_STD_VARIANT>
1275 class ConstructFromStdVisitor;
1279#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1285template <class t_VARIANT, class t_STD_VARIANT>
1286class Variant_ImpUtil::ConstructFromStdVisitor {
1289 t_VARIANT& d_target;
1290 t_STD_VARIANT& d_original;
1299 explicit ConstructFromStdVisitor(t_VARIANT& target,
1300 t_STD_VARIANT& original);
1314 template <size_t t_INDEX, class t_TYPE>
1315 void operator()(bsl::in_place_index_t<t_INDEX>, t_TYPE&) const;
1319#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
1326template <class t_TYPE>
1327struct Variant_ArrayHelper {
1335template <class t_TYPE, class = void>
1336struct Variant_CheckForP1957R2 : bsl::true_type {
1339template <class t_TYPE>
1340struct Variant_CheckForP1957R2<
1342 bsl::void_t<decltype(Variant_ArrayHelper<t_TYPE>{{"bc"}})> >
1346template <class t_DEST, class t_SOURCE, class = void>
1347struct Variant_ConvertsWithoutNarrowing : bsl::false_type {
1364template <class t_DEST, class t_SOURCE>
1365struct Variant_ConvertsWithoutNarrowing<
1368 bsl::void_t<decltype(
1369 Variant_ArrayHelper<t_DEST>{{std::declval<t_SOURCE>()}})> >
1370: bsl::integral_constant<
1372 !(!Variant_CheckForP1957R2<bool>::value &&
1373 bsl::is_same<bool, typename bsl::remove_cvref<t_DEST>::type>::value &&
1375 typename bsl::remove_cvref<t_SOURCE>::type>::value)> {
1395template <class t_SRC, size_t t_INDEX, class t_HEAD, class... t_TAIL>
1396struct Variant_OverloadSetImp
1397: Variant_OverloadSetImp<t_SRC, t_INDEX + 1, t_TAIL...> {
1399 using Variant_OverloadSetImp<t_SRC, t_INDEX + 1, t_TAIL...>::candidate;
1401 template <class t_DEST = t_HEAD>
1402 static typename bsl::enable_if<
1403 Variant_ConvertsWithoutNarrowing<t_DEST, t_SRC>::value,
1404 bsl::integral_constant<size_t, t_INDEX> >::type candidate(t_HEAD);
1406template <class t_SRC, size_t t_INDEX, class t_HEAD>
1407struct Variant_OverloadSetImp<t_SRC, t_INDEX, t_HEAD> {
1408 template <class t_DEST = t_HEAD>
1409 static typename bsl::enable_if<
1410 Variant_ConvertsWithoutNarrowing<t_DEST, t_SRC>::value,
1411 bsl::integral_constant<size_t, t_INDEX> >::type candidate(t_HEAD);
1420template <class t_SRC, class t_VARIANT, class = void>
1421struct Variant_OverloadHelper {
1423 typedef bsl::integral_constant<size_t, bsl::variant_npos> Index;
1429template <class t_SRC, class t_HEAD, class... t_TAIL>
1430struct Variant_OverloadHelper<
1432 bsl::variant<t_HEAD, t_TAIL...>,
1433 bsl::void_t<decltype(Variant_OverloadSetImp<t_SRC, 0, t_HEAD, t_TAIL...>::
1434 candidate(std::declval<t_SRC>()))> > {
1436 Variant_OverloadSetImp<t_SRC, 0, t_HEAD, t_TAIL...>::candidate(
1437 std::declval<t_SRC>())) Index;
1449template <class t_TYPE, class t_VARIANT>
1450struct Variant_ConvertIndex
1451: Variant_OverloadHelper<t_TYPE, t_VARIANT>::Index {
1456#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1457template <size_t t_INDEX,
1459 class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE,
1461struct Variant_ConvertToIndexImpl;
1469template <size_t t_INDEX, class t_TYPE>
1470struct Variant_ConvertToIndexImpl<t_INDEX, t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE>
1471: bsl::integral_constant<size_t, bsl::variant_npos> {
1475template <size_t t_INDEX, class t_TYPE, class t_HEAD, class... t_TAIL>
1476struct Variant_ConvertToIndexImpl<t_INDEX, t_TYPE, t_HEAD, t_TAIL...>
1478 bsl::is_same<typename bsl::remove_cv<t_TYPE>::type,
1479 typename bsl::remove_cv<t_HEAD>::type>::value,
1480 bsl::integral_constant<size_t, t_INDEX>,
1481 Variant_ConvertToIndexImpl<t_INDEX + 1, t_TYPE, t_TAIL...> >::type {
1484template <class t_TYPE, class t_VARIANT>
1485struct Variant_ConvertIndex;
1498template <class t_TYPE, class t_HEAD, class... t_TAIL>
1499struct Variant_ConvertIndex<t_TYPE, bsl::variant<t_HEAD, t_TAIL...> >
1500: Variant_ConvertToIndexImpl<
1502 typename bslmf::MovableRefUtil::RemoveReference<t_TYPE>::type,
1515template <class t_VARIANT,
1517 size_t t_INDEX = BSLSTL_VARIANT_CONVERT_INDEX_OF(t_TYPE, t_VARIANT)>
1518struct Variant_IsAlternativeConstructibleFrom
1519: bsl::integral_constant<
1521 Variant_IsConstructible<
1522 typename bsl::variant_alternative<t_INDEX, t_VARIANT>::type,
1524 Variant_HasUniqueCVType<BSLSTL_VARIANT_CONVERT_TYPE_OF(t_TYPE,
1526 t_VARIANT>::value> {
1529template <class t_VARIANT, class t_TYPE>
1530struct Variant_IsAlternativeConstructibleFrom<t_VARIANT,
1541template <class t_VARIANT,
1543 size_t t_INDEX = BSLSTL_VARIANT_CONVERT_INDEX_OF(t_TYPE, t_VARIANT)>
1544struct Variant_isAlternativeAssignableFrom
1545: bsl::integral_constant<
1547 Variant_IsAssignable<
1548 typename bsl::variant_alternative<t_INDEX, t_VARIANT>::type&,
1550 Variant_HasUniqueCVType<BSLSTL_VARIANT_CONVERT_TYPE_OF(t_TYPE,
1552 t_VARIANT>::value> {
1555template <class t_VARIANT, class t_TYPE>
1556struct Variant_isAlternativeAssignableFrom<t_VARIANT,
1565template <class t_TYPE>
1566struct Variant_CorrespondingStdVariant {
1570#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1571template <class t_HEAD, class... t_TAIL>
1572struct Variant_CorrespondingStdVariant<bsl::variant<t_HEAD, t_TAIL...>> {
1573 typedef std::variant<t_HEAD, t_TAIL...> type;
1585template <class t_VARIANT, class t_TYPE>
1586struct Variant_ConstructsFromType
1587: bsl::integral_constant<
1589 !bsl::is_same<typename bsl::remove_cvref<t_TYPE>::type,
1590 t_VARIANT>::value &&
1591 !Variant_IsTag<typename bsl::remove_cvref<t_TYPE>::type>::value &&
1593 typename Variant_CorrespondingStdVariant<t_VARIANT>::type,
1594 typename bsl::remove_cvref<t_TYPE>::type>::value &&
1595 Variant_IsAlternativeConstructibleFrom<t_VARIANT, t_TYPE>::value> {
1605template <class t_VARIANT, class t_TYPE>
1606struct Variant_AssignsFromType
1607: bsl::integral_constant<
1609 !bsl::is_same<typename bsl::remove_cvref<t_TYPE>::type,
1610 t_VARIANT>::value &&
1611 Variant_IsAlternativeConstructibleFrom<t_VARIANT, t_TYPE>::value &&
1612 Variant_isAlternativeAssignableFrom<t_VARIANT, t_TYPE>::value> {
1615#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1616template <class t_VARIANT, class t_STD_VARIANT>
1617constexpr bool variant_constructsFromStd =
1629 bsl::is_same<typename Variant_CorrespondingStdVariant<t_VARIANT>::type,
1630 bsl::remove_cvref_t<t_STD_VARIANT>>,
1631 std::is_constructible<bsl::remove_cvref_t<t_STD_VARIANT>,
1635#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
1642template <bool t_ISCOPYCONSTRUCTIBLE>
1643struct Variant_CopyConstructorBase {
1646struct Variant_CopyConstructorBase<false> {
1647 Variant_CopyConstructorBase() = default;
1648 Variant_CopyConstructorBase(const Variant_CopyConstructorBase&) = delete;
1649 Variant_CopyConstructorBase(Variant_CopyConstructorBase&&) = default;
1650 Variant_CopyConstructorBase&
1651 operator=(const Variant_CopyConstructorBase&) = default;
1652 Variant_CopyConstructorBase&
1653 operator=(Variant_CopyConstructorBase&&) = default;
1659template <bool t_ISCOPYCONSTRUCTIBLE, bool t_ISMOVECONSTRUCTIBLE>
1660struct Variant_MoveConstructorBase
1661: Variant_CopyConstructorBase<t_ISCOPYCONSTRUCTIBLE> {
1663template <bool t_ISCOPYCONSTRUCTIBLE>
1664struct Variant_MoveConstructorBase<t_ISCOPYCONSTRUCTIBLE, false>
1665: Variant_CopyConstructorBase<t_ISCOPYCONSTRUCTIBLE> {
1666 Variant_MoveConstructorBase() = default;
1667 Variant_MoveConstructorBase(const Variant_MoveConstructorBase&) = default;
1668 Variant_MoveConstructorBase(Variant_MoveConstructorBase&&) = delete;
1669 Variant_MoveConstructorBase&
1670 operator=(const Variant_MoveConstructorBase&) = default;
1671 Variant_MoveConstructorBase&
1672 operator=(Variant_MoveConstructorBase&&) = default;
1678template <bool t_ISCOPYCONSTRUCTIBLE,
1679 bool t_ISMOVECONSTRUCTIBLE,
1680 bool t_ISCOPYASSIGNABLE>
1681struct Variant_CopyAssignBase
1682: Variant_MoveConstructorBase<t_ISCOPYCONSTRUCTIBLE, t_ISMOVECONSTRUCTIBLE> {
1684template <bool t_ISCOPYCONSTRUCTIBLE, bool t_ISMOVECONSTRUCTIBLE>
1685struct Variant_CopyAssignBase<t_ISCOPYCONSTRUCTIBLE,
1686 t_ISMOVECONSTRUCTIBLE,
1688: Variant_MoveConstructorBase<t_ISCOPYCONSTRUCTIBLE, t_ISMOVECONSTRUCTIBLE> {
1689 Variant_CopyAssignBase() = default;
1690 Variant_CopyAssignBase(const Variant_CopyAssignBase&) = default;
1691 Variant_CopyAssignBase(Variant_CopyAssignBase&&) = default;
1692 Variant_CopyAssignBase& operator=(const Variant_CopyAssignBase&) = delete;
1693 Variant_CopyAssignBase& operator=(Variant_CopyAssignBase&&) = default;
1699template <bool t_ISCOPYCONSTRUCTIBLE,
1700 bool t_ISMOVECONSTRUCTIBLE,
1701 bool t_ISCOPYASSIGNABLE,
1702 bool t_ISMOVEASSIGNABLE>
1703struct Variant_MoveAssignBase : Variant_CopyAssignBase<t_ISCOPYCONSTRUCTIBLE,
1704 t_ISMOVECONSTRUCTIBLE,
1705 t_ISCOPYASSIGNABLE> {
1707template <bool t_ISCOPYCONSTRUCTIBLE,
1708 bool t_ISMOVECONSTRUCTIBLE,
1709 bool t_ISCOPYASSIGNABLE>
1710struct Variant_MoveAssignBase<t_ISCOPYCONSTRUCTIBLE,
1711 t_ISMOVECONSTRUCTIBLE,
1714: Variant_CopyAssignBase<t_ISCOPYCONSTRUCTIBLE,
1715 t_ISMOVECONSTRUCTIBLE,
1716 t_ISCOPYASSIGNABLE> {
1717 Variant_MoveAssignBase() = default;
1718 Variant_MoveAssignBase(const Variant_MoveAssignBase&) = default;
1719 Variant_MoveAssignBase(Variant_MoveAssignBase&&) = default;
1720 Variant_MoveAssignBase& operator=(const Variant_MoveAssignBase&) = default;
1721 Variant_MoveAssignBase& operator=(Variant_MoveAssignBase&&) = delete;
1727template <bool t_ISCOPYCONSTRUCTIBLE,
1728 bool t_ISMOVECONSTRUCTIBLE,
1729 bool t_ISCOPYASSIGNABLE,
1730 bool t_ISMOVEASSIGNABLE>
1731struct Variant_SMFBase : Variant_MoveAssignBase<t_ISCOPYCONSTRUCTIBLE,
1732 t_ISMOVECONSTRUCTIBLE,
1734 t_ISMOVEASSIGNABLE> {
1740template <class t_HEAD, class... t_TAIL>
1741struct Variant_IsCopyConstructibleAll
1742: bsl::integral_constant<
1744 std::is_copy_constructible<t_HEAD>::value &&
1745 Variant_IsCopyConstructibleAll<t_TAIL...>::value> {
1748template <class t_HEAD>
1749struct Variant_IsCopyConstructibleAll<t_HEAD>
1750: std::is_copy_constructible<t_HEAD> {
1756template <class t_HEAD, class... t_TAIL>
1757struct Variant_IsMoveConstructibleAll
1758: bsl::integral_constant<
1760 std::is_move_constructible<t_HEAD>::value &&
1761 Variant_IsMoveConstructibleAll<t_TAIL...>::value> {
1764template <class t_HEAD>
1765struct Variant_IsMoveConstructibleAll<t_HEAD>
1766: std::is_move_constructible<t_HEAD> {
1772template <class t_HEAD, class... t_TAIL>
1773struct Variant_IsCopyAssignableAll
1774: bsl::integral_constant<bool,
1775 std::is_copy_assignable<t_HEAD>::value &&
1776 Variant_IsCopyAssignableAll<t_TAIL...>::value> {
1779template <class t_HEAD>
1780struct Variant_IsCopyAssignableAll<t_HEAD> : std::is_copy_assignable<t_HEAD> {
1786template <class t_HEAD, class... t_TAIL>
1787struct Variant_IsMoveAssignableAll
1788: bsl::integral_constant<bool,
1789 std::is_move_assignable<t_HEAD>::value &&
1790 Variant_IsMoveAssignableAll<t_TAIL...>::value> {
1793template <class t_HEAD>
1794struct Variant_IsMoveAssignableAll<t_HEAD> : std::is_move_assignable<t_HEAD> {
1798#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
1799template <class t_RET, class t_VISITOR, class t_VARIANT, size_t t_INDEX>
1800struct Variant_Function {
1807 static t_RET functionImpl(t_VISITOR&& visitor, t_VARIANT&& variant)
1809#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1811 std::forward<t_VISITOR>(visitor),
1812 bsl::get<t_INDEX>(std::forward<t_VARIANT>(variant)));
1814 return std::forward<t_VISITOR>(visitor)(
1815 bsl::get<t_INDEX>(std::forward<t_VARIANT>(variant)));
1824template <class t_VISITOR, class t_VARIANT, size_t t_INDEX>
1825struct Variant_Function<void, t_VISITOR, t_VARIANT, t_INDEX> {
1827 static void functionImpl(t_VISITOR&& visitor, t_VARIANT&& variant)
1829#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
1830 std::invoke(std::forward<t_VISITOR>(visitor),
1831 bsl::get<t_INDEX>(std::forward<t_VARIANT>(variant)));
1833 std::forward<t_VISITOR>(visitor)(
1834 bsl::get<t_INDEX>(std::forward<t_VARIANT>(variant)));
1839template <class t_RET, class t_VISITOR, class t_VARIANT, size_t t_INDEX>
1840struct Variant_FunctionId {
1847 static t_RET functionImpl(t_VISITOR&& visitor, t_VARIANT&& variant)
1849 return visitor(bsl::in_place_index_t<t_INDEX>(),
1850 bsl::get<t_INDEX>(std::forward<t_VARIANT>(variant)));
1859template <class t_RET, class t_VISITOR, class t_VARIANT, class t_DUMMY>
1860struct Variant_VTable;
1864template <class t_RET, class t_VISITOR, class t_VARIANT, size_t... t_INDICES>
1865struct Variant_VTable<t_RET,
1868 bslmf::IntegerSequence<std::size_t, t_INDICES...> > {
1869 BSLMF_ASSERT(bsl::is_reference<t_VISITOR>::value);
1870 BSLMF_ASSERT(bsl::is_reference<t_VARIANT>::value);
1872 typedef t_RET (*FuncPtr)(t_VISITOR, t_VARIANT);
1874 static BSLS_KEYWORD_CONSTEXPR FuncPtr s_map[sizeof...(t_INDICES)] = {
1875 &(Variant_Function<t_RET, t_VISITOR, t_VARIANT, t_INDICES>::
1889template <class t_RET, class t_VISITOR, class t_VARIANT, class t_DUMMY>
1890struct Variant_VTableId;
1894template <class t_RET, class t_VISITOR, class t_VARIANT, size_t... t_INDICES>
1895struct Variant_VTableId<t_RET,
1898 bslmf::IntegerSequence<std::size_t, t_INDICES...> > {
1899 BSLMF_ASSERT(bsl::is_reference<t_VISITOR>::value);
1900 BSLMF_ASSERT(bsl::is_reference<t_VARIANT>::value);
1902 typedef t_RET (*FuncPtr)(t_VISITOR, t_VARIANT);
1904 static BSLS_KEYWORD_CONSTEXPR FuncPtr s_mapId[sizeof...(t_INDICES)] = {
1905 &(Variant_FunctionId<t_RET, t_VISITOR, t_VARIANT, t_INDICES>::
1910template <class t_RET, class t_VISITOR, class t_VARIANT, size_t... t_INDICES>
1911BSLS_KEYWORD_CONSTEXPR typename Variant_VTable<
1915 bslmf::IntegerSequence<std::size_t, t_INDICES...> >::FuncPtr
1916 Variant_VTable<t_RET,
1919 bslmf::IntegerSequence<std::size_t, t_INDICES...> >::s_map
1920 [sizeof...(t_INDICES)];
1922template <class t_RET, class t_VISITOR, class t_VARIANT, size_t... t_INDICES>
1923BSLS_KEYWORD_CONSTEXPR typename Variant_VTableId<
1927 bslmf::IntegerSequence<std::size_t, t_INDICES...> >::FuncPtr
1928 Variant_VTableId<t_RET,
1931 bslmf::IntegerSequence<std::size_t, t_INDICES...> >::
1932 s_mapId[sizeof...(t_INDICES)];
1935#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
1937template <class t_RET, class t_VISITOR, class t_VARIANT, class t_ALT_TYPE>
1938struct Variant_Function {
1939 static t_RET functionImpl(t_VISITOR& visitor, t_VARIANT& variant)
1946 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
1947 return visitor(ImpUtil::unsafeGet<t_ALT_TYPE>(variant));
1951template <class t_VISITOR, class t_VARIANT, class t_ALT_TYPE>
1952struct Variant_Function<void, t_VISITOR, t_VARIANT, t_ALT_TYPE> {
1958 static void functionImpl(t_VISITOR& visitor, t_VARIANT& variant)
1960 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
1961 visitor(ImpUtil::unsafeGet<t_ALT_TYPE>(variant));
1965template <class t_RET, class t_VISITOR, class t_VARIANT, class t_ALT_TYPE>
1966struct Variant_MoveFunction {
1967 static t_RET functionImpl(t_VISITOR& visitor, t_VARIANT& variant)
1975 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
1976 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
1979 MoveUtil::move(ImpUtil::unsafeGet<t_ALT_TYPE>(variant)));
1983template <class t_VISITOR, class t_VARIANT, class t_ALT_TYPE>
1984struct Variant_MoveFunction<void, t_VISITOR, t_VARIANT, t_ALT_TYPE> {
1990 static void functionImpl(t_VISITOR& visitor, t_VARIANT& variant)
1992 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
1993 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
1995 visitor(MoveUtil::move(ImpUtil::unsafeGet<t_ALT_TYPE>(variant)));
1999template <class t_RET, class t_VISITOR, class t_VARIANT, class t_ALT_TYPE>
2000struct Variant_FunctionId {
2001 static t_RET functionImpl(t_VISITOR& visitor, t_VARIANT& variant)
2012 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2013 static const size_t t_INDEX = BSLSTL_VARIANT_INDEX_OF(
2014 t_ALT_TYPE, typename bsl::remove_cv<t_VARIANT>::type);
2016 return visitor(bsl::in_place_index_t<t_INDEX>(),
2017 ImpUtil::unsafeGet<t_ALT_TYPE>(variant));
2021template <class t_RET, class t_VISITOR, class t_VARIANT, class... t_UNUSED>
2022struct Variant_VTable;
2031template <class t_RET, class t_VISITOR, class t_HEAD, class... t_TAIL>
2032struct Variant_VTable<t_RET, t_VISITOR, bsl::variant<t_HEAD, t_TAIL...> > {
2036 typedef t_RET (*FuncPtr)(t_VISITOR&, bsl::variant<t_HEAD, t_TAIL...>&);
2038 typedef bsl::variant<t_HEAD, t_TAIL...> Variant;
2040 static const FuncPtr *map()
2045 static const FuncPtr s_mapArray[] = {
2046 &(Variant_Function<t_RET, t_VISITOR, Variant, t_HEAD>::
2048 &(Variant_Function<t_RET, t_VISITOR, Variant, t_TAIL>::
2053 static const FuncPtr *moveMap()
2058 static const FuncPtr s_mapArray[] = {
2059 &(Variant_MoveFunction<t_RET, t_VISITOR, Variant, t_HEAD>::
2061 &(Variant_MoveFunction<t_RET, t_VISITOR, Variant, t_TAIL>::
2066 static const FuncPtr *mapId()
2073 static const FuncPtr s_mapArray[] = {
2074 &(Variant_FunctionId<t_RET, t_VISITOR, Variant, t_HEAD>::
2076 &(Variant_FunctionId<t_RET, t_VISITOR, Variant, t_TAIL>::
2082template <class t_RET, class t_VISITOR, class t_HEAD, class... t_TAIL>
2083struct Variant_VTable<t_RET,
2085 const bsl::variant<t_HEAD, t_TAIL...> > {
2088 typedef t_RET (*FuncPtr)(t_VISITOR&,
2089 const bsl::variant<t_HEAD, t_TAIL...>&);
2091 typedef const bsl::variant<t_HEAD, t_TAIL...> Variant;
2093 static const FuncPtr *map()
2098 static const FuncPtr s_mapArray[] = {
2099 &(Variant_Function<t_RET, t_VISITOR, Variant, t_HEAD>::
2101 &(Variant_Function<t_RET, t_VISITOR, Variant, t_TAIL>::
2106 static const FuncPtr *mapId()
2113 static const FuncPtr s_mapArray[] = {
2114 &(Variant_FunctionId<t_RET, t_VISITOR, Variant, t_HEAD>::
2116 &(Variant_FunctionId<t_RET, t_VISITOR, Variant, t_TAIL>::
2129#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
2144template <class t_RET, class t_VISITOR, class t_VARIANT>
2145t_RET visit(t_VISITOR&& visitor, t_VARIANT&& variant)
2147 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2149 if (variant.valueless_by_exception()) {
2150 BSLS_THROW(bsl::bad_variant_access());
2152 return ImpUtil::visit<t_RET>(std::forward<t_VISITOR>(visitor),
2153 std::forward<t_VARIANT>(variant));
2167template <class t_VISITOR, class t_VARIANT>
2168typename bsl::invoke_result<
2170 typename BloombergLP::bslstl::Variant_CVQualAlt<t_VARIANT, 0>::type>::type
2171visit(t_VISITOR&& visitor, t_VARIANT&& variant)
2173 typedef typename bsl::invoke_result<
2175 typename BloombergLP::bslstl::Variant_CVQualAlt<t_VARIANT&&,
2176 0>::type>::type RET;
2177 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2180 BloombergLP::bslstl::
2181 Variant_IsSameReturnType<RET, t_VISITOR&&, t_VARIANT&&>::value,
2182 "The value type and category of invoking the visitor with "
2183 "every alternative is not the same");
2184 if (variant.valueless_by_exception()) {
2185 BSLS_THROW(bsl::bad_variant_access());
2187 return ImpUtil::visit<RET>(std::forward<t_VISITOR>(visitor),
2188 std::forward<t_VARIANT>(variant));
2199template <class t_RET, class t_VISITOR, class t_VARIANT>
2200t_RET visitR(t_VISITOR& visitor, t_VARIANT&& variant)
2202 return visit<t_RET>(visitor, std::forward<t_VARIANT>(variant));
2206template <class t_RET, class t_VISITOR, class t_VARIANT>
2207t_RET visitR(t_VISITOR& visitor, t_VARIANT& variant)
2223 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2225 if (variant.valueless_by_exception()) {
2226 BSLS_THROW(bsl::bad_variant_access());
2228 return ImpUtil::visit<t_RET>(visitor, variant);
2231template <class t_RET, class t_VISITOR, class t_VARIANT>
2232t_RET visitR(t_VISITOR& visitor,
2233 BloombergLP::bslmf::MovableRef<t_VARIANT> variant)
2249 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2251 t_VARIANT& lvalue = variant;
2252 if (lvalue.valueless_by_exception()) {
2253 BSLS_THROW(bsl::bad_variant_access());
2255 return ImpUtil::moveVisit<t_RET>(visitor, lvalue);
2258template <class t_VISITOR, class t_VARIANT>
2259typename bsl::invoke_result<
2261 typename bsl::variant_alternative<0, t_VARIANT>::type&>::type
2262visit(t_VISITOR& visitor, t_VARIANT& variant)
2269 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2271 if (variant.valueless_by_exception()) {
2272 BSLS_THROW(bsl::bad_variant_access());
2274 typedef typename bsl::invoke_result<
2276 typename bsl::variant_alternative<0, t_VARIANT>::type&>::type Ret;
2279 (BloombergLP::bslstl::
2280 Variant_IsSameReturnType<Ret, t_VISITOR, t_VARIANT&>::value));
2282 return ImpUtil::visit<Ret>(visitor, variant);
2285template <class t_VISITOR, class t_VARIANT>
2286typename bsl::invoke_result<
2288 BloombergLP::bslmf::MovableRef<
2289 typename bsl::variant_alternative<0, t_VARIANT>::type> >::type
2290visit(t_VISITOR& visitor, BloombergLP::bslmf::MovableRef<t_VARIANT> variant)
2298 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2300 t_VARIANT& lvalue = variant;
2301 if (lvalue.valueless_by_exception()) {
2302 BSLS_THROW(bsl::bad_variant_access());
2304 typedef typename bsl::invoke_result<
2306 BloombergLP::bslmf::MovableRef<
2307 typename bsl::variant_alternative<0, t_VARIANT>::type> >::type Ret;
2309 BSLMF_ASSERT((BloombergLP::bslstl::Variant_IsSameReturnType<
2312 BloombergLP::bslmf::MovableRef<t_VARIANT> >::value));
2314 return ImpUtil::moveVisit<Ret>(visitor, lvalue);
2340struct Variant_NoSuchType {
2345 explicit BSLS_KEYWORD_CONSTEXPR Variant_NoSuchType(
2346 int) BSLS_KEYWORD_NOEXCEPT;
2349#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
2357template <class t_TYPE>
2358class Variant_DataImp {
2362 typedef typename bsl::remove_const<t_TYPE>::type StoredType;
2365 bsls::ObjectBuffer<StoredType> d_buffer;
2369 Variant_DataImp() = default;
2379 template <class... t_ARGS>
2380 Variant_DataImp(t_ARGS&&... args);
2382 BSLS_KEYWORD_CONSTEXPR_CPP14 t_TYPE& value() &;
2383 BSLS_KEYWORD_CONSTEXPR_CPP14 t_TYPE&& value() &&;
2390 BSLS_KEYWORD_CONSTEXPR_CPP14 const t_TYPE& value() const&;
2391 BSLS_KEYWORD_CONSTEXPR_CPP14 const t_TYPE&& value() const&&;
2401template <class... t_TYPES>
2402union Variant_Union {
2407template <class t_HEAD, class... t_TAIL>
2408union Variant_Union<t_HEAD, t_TAIL...> {
2411 Variant_DataImp<t_HEAD> d_head;
2412 Variant_Union<t_TAIL...> d_tail;
2415 Variant_Union() = default;
2420 template <class... t_ARGS>
2421 Variant_Union(bsl::in_place_index_t<0>, t_ARGS&&... args)
2422 : d_head(std::forward<t_ARGS>(args)...)
2434 template <size_t t_INDEX, class... t_ARGS>
2435 Variant_Union(bsl::in_place_index_t<t_INDEX>, t_ARGS&&... args)
2436 : d_tail(bsl::in_place_index_t<t_INDEX - 1>(),
2437 std::forward<t_ARGS>(args)...)
2442template <class t_TYPE>
2443class Variant_DataImp {
2452 typedef typename bsl::remove_const<t_TYPE>::type StoredType;
2455 bsls::ObjectBuffer<StoredType> d_buffer;
2459 Variant_DataImp() = default;
2470 const t_TYPE& value() const;
2477#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2478template <class t_HEAD = void, class... t_TAIL0 = void, class... t_TAIL>
2487union Variant_Union<void, void> {
2492union Variant_Union<BloombergLP::bsls::CompilerFeaturesNilT> {
2495template <class t_HEAD, class t_TAIL0, class... t_TAIL>
2496union Variant_Union<t_HEAD, t_TAIL0, t_TAIL...> {
2503 Variant_DataImp<t_HEAD> d_head;
2504 Variant_Union<t_TAIL0, t_TAIL...> d_tail;
2517template <class t_VARIANT_BASE>
2518class Variant_CopyConstructVisitor {
2522 t_VARIANT_BASE *d_variant_p;
2526 explicit Variant_CopyConstructVisitor(t_VARIANT_BASE *variant)
2529 : d_variant_p(variant)
2531 BSLS_ASSERT_SAFE(d_variant_p);
2540 template <size_t t_INDEX, class t_TYPE>
2541 void operator()(bsl::in_place_index_t<t_INDEX>, const t_TYPE& other) const
2543 d_variant_p->template baseEmplace<t_INDEX>(other);
2555template <class t_VARIANT_BASE>
2560 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
2563 t_VARIANT_BASE *d_variant_p;
2571 : d_variant_p(variant)
2582 template <
size_t t_INDEX,
class t_TYPE>
2585 d_variant_p->template baseEmplace<t_INDEX>(MoveUtil::move(other));
2597template <
class t_VARIANT>
2602 t_VARIANT *d_variant_p;
2610 : d_variant_p(variant)
2625 template <
size_t t_INDEX,
class t_TYPE>
2628#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
2629 bsl::get<t_INDEX>(*d_variant_p) = value;
2638 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2640 ImpUtil::unsafeGet<Alt_Type>(*d_variant_p) = value;
2653template <
class t_VARIANT>
2658 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
2661 t_VARIANT *d_variant_p;
2669 : d_variant_p(variant)
2683 template <
size_t t_INDEX,
class t_TYPE>
2686#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
2687 bsl::get<t_INDEX>(*d_variant_p) = MoveUtil::move(value);
2689 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2690 ImpUtil::unsafeGet<t_TYPE>(*d_variant_p) = MoveUtil::move(value);
2708 template <
class t_TYPE>
2711 bslma::DestructionUtil::destroy(&
object);
2719#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
2720#define BSLSTL_VARIANT_RELOP_VISITOR_DEFINITON(NAME, OP) \
2721 template <class t_VARIANT> \
2722 struct Variant_##NAME##Visitor { \
2725 explicit Variant_##NAME##Visitor(const t_VARIANT *variant) \
2726 : d_variant_p(variant) \
2728 BSLS_ASSERT_SAFE(d_variant_p); \
2732 const t_VARIANT *d_variant_p; \
2735 template <size_t t_INDEX, class t_TYPE> \
2736 bool operator()(bsl::in_place_index_t<t_INDEX>, \
2737 const t_TYPE& value) const \
2739 return (bsl::get<t_INDEX>(*d_variant_p) OP value); \
2743 template <class t_VARIANT> \
2744 bool Variant_ImpUtil::NAME(const t_VARIANT& lhs, const t_VARIANT& rhs) \
2746 BSLS_ASSERT(lhs.index() == rhs.index() && \
2747 !lhs.valueless_by_exception()); \
2749 Variant_##NAME##Visitor<t_VARIANT> NAME##Visitor( \
2750 BSLS_UTIL_ADDRESSOF(lhs)); \
2751 return BSLSTL_VARIANT_VISITID(bool, NAME##Visitor, rhs); \
2754#define BSLSTL_VARIANT_RELOP_VISITOR_DEFINITON(NAME, OP) \
2755 template <class t_VARIANT> \
2756 struct Variant_##NAME##Visitor { \
2757 Variant_##NAME##Visitor(const t_VARIANT *variant) \
2758 : d_variant_p(variant) \
2760 BSLS_ASSERT_SAFE(d_variant_p); \
2764 const t_VARIANT *d_variant_p; \
2767 template <size_t t_INDEX, class t_TYPE> \
2768 bool operator()(bsl::in_place_index_t<t_INDEX>, \
2769 t_TYPE& value) const \
2778 typename bsl::variant_alternative<t_INDEX, t_VARIANT>::type \
2780 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil; \
2781 return (ImpUtil::unsafeGet<Alt_Type>(*d_variant_p) OP value); \
2785 template <class t_VARIANT> \
2786 bool Variant_ImpUtil::NAME(const t_VARIANT& lhs, const t_VARIANT& rhs) \
2788 BSLS_ASSERT(lhs.index() == rhs.index() && \
2789 !lhs.valueless_by_exception()); \
2791 Variant_##NAME##Visitor<t_VARIANT> NAME##Visitor( \
2792 BSLS_UTIL_ADDRESSOF(lhs)); \
2793 return BSLSTL_VARIANT_VISITID(bool, NAME##Visitor, rhs); \
2813template <class t_VARIANT>
2818 t_VARIANT *d_variant_p;
2827 : d_variant_p(variant)
2840 template <
size_t t_INDEX,
class t_TYPE>
2843#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
2844 BloombergLP::bslalg::SwapUtil::swap(
2848 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
2853 BloombergLP::bslalg::SwapUtil::swap(
2868template <
class t_HASHALG>
2873 t_HASHALG& d_hashAlg;
2881 : d_hashAlg(hashAlg)
2889 template <
class t_TYPE>
2892 using BloombergLP::bslh::hashAppend;
2893 hashAppend(d_hashAlg, value);
2939 : d_allocator(original.d_allocator)
2946 : d_allocator(allocator)
2963#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
2970template <
class t_HEAD,
class... t_TAIL>
2972:
public BloombergLP::bslstl::Variant_AllocatorBase<
2973 BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny<t_HEAD,
2974 t_TAIL...>::value> {
2978 typedef BloombergLP::bslstl::Variant_AllocatorBase<
2979 BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny<t_HEAD,
2982 typedef BloombergLP::bslstl::Variant_Union<t_HEAD, t_TAIL...>
2993 BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny<t_HEAD,
3010 BloombergLP::bslma::UsesBslmaAllocator,
3011 (BloombergLP::bslstl::
3015 BloombergLP::bslmf::UsesAllocatorArgT,
3016 (BloombergLP::bslstl::
3020 BloombergLP::bslmf::IsBitwiseMoveable,
3021 (BloombergLP::bslstl::Variant_IsBitwiseMoveableAll<t_HEAD,
3022 t_TAIL...>::value));
3025#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
3048#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3059 template <
size_t t_INDEX,
class... t_ARGS>
3082#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3097 template <
size_t t_INDEX,
class... t_ARGS>
3119 Variant_Base(BloombergLP::bslmf::MovableRef<Variant> original);
3127 template <
size_t t_INDEX>
3134 template <
size_t t_INDEX,
class t_ARG_01>
3136 const t_ARG_01& arg_01);
3138 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
3140 const t_ARG_01& arg_01,
3141 const t_ARG_02& arg_02);
3143 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
3145 const t_ARG_01& arg_01,
3146 const t_ARG_02& arg_02,
3147 const t_ARG_03& arg_03);
3149 template <
size_t t_INDEX,
3155 const t_ARG_01& arg_01,
3156 const t_ARG_02& arg_02,
3157 const t_ARG_03& arg_03,
3158 const t_ARG_04& arg_04);
3160 template <
size_t t_INDEX,
3167 const t_ARG_01& arg_01,
3168 const t_ARG_02& arg_02,
3169 const t_ARG_03& arg_03,
3170 const t_ARG_04& arg_04,
3171 const t_ARG_05& arg_05);
3173 template <
size_t t_INDEX,
3181 const t_ARG_01& arg_01,
3182 const t_ARG_02& arg_02,
3183 const t_ARG_03& arg_03,
3184 const t_ARG_04& arg_04,
3185 const t_ARG_05& arg_05,
3186 const t_ARG_06& arg_06);
3188 template <
size_t t_INDEX,
3197 const t_ARG_01& arg_01,
3198 const t_ARG_02& arg_02,
3199 const t_ARG_03& arg_03,
3200 const t_ARG_04& arg_04,
3201 const t_ARG_05& arg_05,
3202 const t_ARG_06& arg_06,
3203 const t_ARG_07& arg_07);
3205 template <
size_t t_INDEX,
3215 const t_ARG_01& arg_01,
3216 const t_ARG_02& arg_02,
3217 const t_ARG_03& arg_03,
3218 const t_ARG_04& arg_04,
3219 const t_ARG_05& arg_05,
3220 const t_ARG_06& arg_06,
3221 const t_ARG_07& arg_07,
3222 const t_ARG_08& arg_08);
3224 template <
size_t t_INDEX,
3235 const t_ARG_01& arg_01,
3236 const t_ARG_02& arg_02,
3237 const t_ARG_03& arg_03,
3238 const t_ARG_04& arg_04,
3239 const t_ARG_05& arg_05,
3240 const t_ARG_06& arg_06,
3241 const t_ARG_07& arg_07,
3242 const t_ARG_08& arg_08,
3243 const t_ARG_09& arg_09);
3245 template <
size_t t_INDEX,
3257 const t_ARG_01& arg_01,
3258 const t_ARG_02& arg_02,
3259 const t_ARG_03& arg_03,
3260 const t_ARG_04& arg_04,
3261 const t_ARG_05& arg_05,
3262 const t_ARG_06& arg_06,
3263 const t_ARG_07& arg_07,
3264 const t_ARG_08& arg_08,
3265 const t_ARG_09& arg_09,
3266 const t_ARG_10& arg_10);
3283 BloombergLP::bslmf::MovableRef<Variant> original);
3291 template <
size_t t_INDEX>
3300 template <
size_t t_INDEX,
class t_ARG_01>
3304 const t_ARG_01& arg_01);
3306 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
3310 const t_ARG_01& arg_01,
3311 const t_ARG_02& arg_02);
3313 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
3317 const t_ARG_01& arg_01,
3318 const t_ARG_02& arg_02,
3319 const t_ARG_03& arg_03);
3321 template <
size_t t_INDEX,
3329 const t_ARG_01& arg_01,
3330 const t_ARG_02& arg_02,
3331 const t_ARG_03& arg_03,
3332 const t_ARG_04& arg_04);
3334 template <
size_t t_INDEX,
3343 const t_ARG_01& arg_01,
3344 const t_ARG_02& arg_02,
3345 const t_ARG_03& arg_03,
3346 const t_ARG_04& arg_04,
3347 const t_ARG_05& arg_05);
3349 template <
size_t t_INDEX,
3359 const t_ARG_01& arg_01,
3360 const t_ARG_02& arg_02,
3361 const t_ARG_03& arg_03,
3362 const t_ARG_04& arg_04,
3363 const t_ARG_05& arg_05,
3364 const t_ARG_06& arg_06);
3366 template <
size_t t_INDEX,
3377 const t_ARG_01& arg_01,
3378 const t_ARG_02& arg_02,
3379 const t_ARG_03& arg_03,
3380 const t_ARG_04& arg_04,
3381 const t_ARG_05& arg_05,
3382 const t_ARG_06& arg_06,
3383 const t_ARG_07& arg_07);
3385 template <
size_t t_INDEX,
3397 const t_ARG_01& arg_01,
3398 const t_ARG_02& arg_02,
3399 const t_ARG_03& arg_03,
3400 const t_ARG_04& arg_04,
3401 const t_ARG_05& arg_05,
3402 const t_ARG_06& arg_06,
3403 const t_ARG_07& arg_07,
3404 const t_ARG_08& arg_08);
3406 template <
size_t t_INDEX,
3419 const t_ARG_01& arg_01,
3420 const t_ARG_02& arg_02,
3421 const t_ARG_03& arg_03,
3422 const t_ARG_04& arg_04,
3423 const t_ARG_05& arg_05,
3424 const t_ARG_06& arg_06,
3425 const t_ARG_07& arg_07,
3426 const t_ARG_08& arg_08,
3427 const t_ARG_09& arg_09);
3429 template <
size_t t_INDEX,
3443 const t_ARG_01& arg_01,
3444 const t_ARG_02& arg_02,
3445 const t_ARG_03& arg_03,
3446 const t_ARG_04& arg_04,
3447 const t_ARG_05& arg_05,
3448 const t_ARG_06& arg_06,
3449 const t_ARG_07& arg_07,
3450 const t_ARG_08& arg_08,
3451 const t_ARG_09& arg_09,
3452 const t_ARG_10& arg_10);
3464#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
3476 template <
size_t t_INDEX,
class... t_ARGS>
3477 void baseEmplace(t_ARGS&&...);
3479 template <
size_t t_INDEX>
3491 template <
size_t t_INDEX,
class t_ARG_01>
3492 void baseEmplace(
const t_ARG_01& arg_01);
3494 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
3495 void baseEmplace(
const t_ARG_01& arg_01,
const t_ARG_02& arg_02);
3497 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
3498 void baseEmplace(
const t_ARG_01& arg_01,
3499 const t_ARG_02& arg_02,
3500 const t_ARG_03& arg_03);
3502 template <
size_t t_INDEX,
3507 void baseEmplace(
const t_ARG_01& arg_01,
3508 const t_ARG_02& arg_02,
3509 const t_ARG_03& arg_03,
3510 const t_ARG_04& arg_04);
3512 template <
size_t t_INDEX,
3518 void baseEmplace(
const t_ARG_01& arg_01,
3519 const t_ARG_02& arg_02,
3520 const t_ARG_03& arg_03,
3521 const t_ARG_04& arg_04,
3522 const t_ARG_05& arg_05);
3524 template <
size_t t_INDEX,
3531 void baseEmplace(
const t_ARG_01& arg_01,
3532 const t_ARG_02& arg_02,
3533 const t_ARG_03& arg_03,
3534 const t_ARG_04& arg_04,
3535 const t_ARG_05& arg_05,
3536 const t_ARG_06& arg_06);
3538 template <
size_t t_INDEX,
3546 void baseEmplace(
const t_ARG_01& arg_01,
3547 const t_ARG_02& arg_02,
3548 const t_ARG_03& arg_03,
3549 const t_ARG_04& arg_04,
3550 const t_ARG_05& arg_05,
3551 const t_ARG_06& arg_06,
3552 const t_ARG_07& arg_07);
3554 template <
size_t t_INDEX,
3563 void baseEmplace(
const t_ARG_01& arg_01,
3564 const t_ARG_02& arg_02,
3565 const t_ARG_03& arg_03,
3566 const t_ARG_04& arg_04,
3567 const t_ARG_05& arg_05,
3568 const t_ARG_06& arg_06,
3569 const t_ARG_07& arg_07,
3570 const t_ARG_08& arg_08);
3572 template <
size_t t_INDEX,
3582 void baseEmplace(
const t_ARG_01& arg_01,
3583 const t_ARG_02& arg_02,
3584 const t_ARG_03& arg_03,
3585 const t_ARG_04& arg_04,
3586 const t_ARG_05& arg_05,
3587 const t_ARG_06& arg_06,
3588 const t_ARG_07& arg_07,
3589 const t_ARG_08& arg_08,
3590 const t_ARG_09& arg_09);
3592 template <
size_t t_INDEX,
3603 void baseEmplace(
const t_ARG_01& arg_01,
3604 const t_ARG_02& arg_02,
3605 const t_ARG_03& arg_03,
3606 const t_ARG_04& arg_04,
3607 const t_ARG_05& arg_05,
3608 const t_ARG_06& arg_06,
3609 const t_ARG_07& arg_07,
3610 const t_ARG_08& arg_08,
3611 const t_ARG_09& arg_09,
3612 const t_ARG_10& arg_10);
3650 Variant_Base& operator=(BloombergLP::bslmf::MovableRef<Variant_Base> rhs);
3665#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
3666template <
class t_HEAD,
class... t_TAIL>
3668:
private BloombergLP::bslstl::Variant_Base<t_HEAD, t_TAIL...>
3669#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
3671 private BloombergLP::bslstl::Variant_SMFBase<
3672 BloombergLP::bslstl::Variant_IsCopyConstructibleAll<t_HEAD,
3674 BloombergLP::bslstl::Variant_IsMoveConstructibleAll<t_HEAD,
3676 BloombergLP::bslstl::Variant_IsCopyConstructibleAll<t_HEAD,
3677 t_TAIL...>::value &&
3678 BloombergLP::bslstl::Variant_IsCopyAssignableAll<t_HEAD,
3680 BloombergLP::bslstl::Variant_IsMoveConstructibleAll<t_HEAD,
3681 t_TAIL...>::value &&
3682 BloombergLP::bslstl::Variant_IsMoveAssignableAll<t_HEAD,
3688 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
3689 typedef BloombergLP::bslstl::Variant_Base<
t_HEAD,
t_TAIL...> Variant_Base;
3690 typedef BloombergLP::bslstl::Variant_Union<
t_HEAD,
t_TAIL...>
3700 friend struct BloombergLP::bslstl::Variant_Base<
t_HEAD,
t_TAIL...>;
3708 BloombergLP::bslma::UsesBslmaAllocator,
3709 (BloombergLP::bslstl::
3710 Variant_UsesBslmaAllocatorAny<
t_HEAD,
t_TAIL...>::value));
3713 BloombergLP::bslmf::UsesAllocatorArgT,
3714 (BloombergLP::bslstl::
3715 Variant_UsesBslmaAllocatorAny<
t_HEAD,
t_TAIL...>::value));
3718 BloombergLP::bslmf::IsBitwiseMoveable,
3719 (BloombergLP::bslstl::Variant_IsBitwiseMoveableAll<
t_HEAD,
3730#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
3741 class =
typename bsl::enable_if_t<
3742 std::is_default_constructible<t_FIRST_ALT>::value> >
3779#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3787 template <
class t_STD_VARIANT>
3791 : Variant_Base(BloombergLP::
bslstl::Variant_ConstructFromStdTag(),
3797 BloombergLP::bslstl::Variant_ImpUtil::
3819 template <
class t_TYPE>
3832 template <
class t_TYPE,
3834 class =
typename bsl::enable_if_t<
3836 std::is_constructible<t_TYPE,
t_ARGS...>::value> >
3847 template <
class t_TYPE,
3850 class =
typename bsl::enable_if_t<
3852 std::is_constructible<t_TYPE,
3853 std::initializer_list<INIT_LIST_TYPE>&,
3856 std::initializer_list<INIT_LIST_TYPE>
il,
3889 class =
typename bsl::enable_if_t<
3890 (
t_INDEX < 1 +
sizeof...(t_TAIL)) &&
3894 : Variant_Base(
bsl::in_place_index_t<
t_INDEX>(),
3905 class =
typename bsl::enable_if_t<
3906 (
t_INDEX < 1 +
sizeof...(t_TAIL)) &&
3908 std::initializer_list<INIT_LIST_TYPE>&,
3911 std::initializer_list<INIT_LIST_TYPE>
il,
3923 : Variant_Base(
bsl::in_place_index_t<
t_INDEX>(),
3933 template <
class FIRST =
t_HEAD,
3934 class =
typename bsl::enable_if_t<
3935 std::is_default_constructible<FIRST>::value> >
3942 : Variant_Base(
bsl::allocator_arg_t(), allocator)
3958 class =
typename bsl::enable_if_t<
3959 BloombergLP::bslstl::
3960 Variant_IsCopyConstructibleAll<FIRST,
t_TAIL...>::value> >
3971 : Variant_Base(
bsl::allocator_arg_t(), allocator,
original)
3979 class =
typename bsl::enable_if_t<
3980 BloombergLP::bslstl::
3981 Variant_IsMoveConstructibleAll<FIRST,
t_TAIL...>::value> >
3983 : Variant_Base(
bsl::allocator_arg_t(), allocator,
std::move(
original))
3990#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3998 template <
class t_STD_VARIANT>
4000 bsl::allocator_arg_t,
4004 : Variant_Base(
bsl::allocator_arg_t(),
4006 BloombergLP::
bslstl::Variant_ConstructFromStdTag(),
4012 BloombergLP::bslstl::Variant_ImpUtil::
4030 template <
class t_TYPE>
4032 bsl::allocator_arg_t,
4043 template <
class t_TYPE,
4045 class =
typename bsl::enable_if_t<
4047 std::is_constructible<t_TYPE,
t_ARGS...>::value> >
4048 explicit variant(bsl::allocator_arg_t,
4053 bsl::allocator_arg_t{},
4063 template <
class t_TYPE,
4066 class =
typename bsl::enable_if_t<
4068 std::is_constructible<t_TYPE,
4069 std::initializer_list<INIT_LIST_TYPE>&,
4071 explicit variant(bsl::allocator_arg_t,
4074 std::initializer_list<INIT_LIST_TYPE>
il,
4083 bsl::allocator_arg_t{},
4096 class =
typename bsl::enable_if_t<
4097 (
t_INDEX < 1 +
sizeof...(t_TAIL)) &&
4100 explicit variant(bsl::allocator_arg_t,
4110 : Variant_Base(
bsl::allocator_arg_t{},
4123 class =
typename bsl::enable_if_t<
4124 (
t_INDEX < 1 +
sizeof...(t_TAIL)) &&
4126 std::initializer_list<INIT_LIST_TYPE>&,
4128 explicit variant(bsl::allocator_arg_t,
4131 std::initializer_list<INIT_LIST_TYPE>
il,
4140 : Variant_Base(
bsl::allocator_arg_t{},
4175 template <
class t_TYPE>
4188 template <
class t_TYPE>
4198 template <
class t_TYPE,
class t_ARG_01>
4203 template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02>
4209 template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
4216 template <
class t_TYPE,
4228 template <
class t_TYPE,
4242 template <
class t_TYPE,
4258 template <
class t_TYPE,
4276 template <
class t_TYPE,
4296 template <
class t_TYPE,
4318 template <
class t_TYPE,
4348 template <
size_t t_INDEX>
4356 template <
size_t t_INDEX,
class t_ARG_01>
4359 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
4364 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
4505 BloombergLP::bslmf::MovableRef<variant>
original);
4513 template <
class t_TYPE>
4515 bsl::allocator_arg_t,
4517 const t_TYPE& value,
4529 template <
class t_TYPE>
4531 bsl::allocator_arg_t,
4543 template <
class t_TYPE,
class t_ARG_01>
4545 bsl::allocator_arg_t,
4551 template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02>
4553 bsl::allocator_arg_t,
4560 template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
4562 bsl::allocator_arg_t,
4570 template <
class t_TYPE,
4584 template <
class t_TYPE,
4600 template <
class t_TYPE,
4618 template <
class t_TYPE,
4638 template <
class t_TYPE,
4660 template <
class t_TYPE,
4684 template <
class t_TYPE,
4716 template <
size_t t_INDEX>
4717 explicit variant(bsl::allocator_arg_t,
4725 template <
size_t t_INDEX,
class t_ARG_01>
4726 explicit variant(bsl::allocator_arg_t,
4731 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
4732 explicit variant(bsl::allocator_arg_t,
4738 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
4739 explicit variant(bsl::allocator_arg_t,
4751 explicit variant(bsl::allocator_arg_t,
4765 explicit variant(bsl::allocator_arg_t,
4781 explicit variant(bsl::allocator_arg_t,
4799 explicit variant(bsl::allocator_arg_t,
4819 explicit variant(bsl::allocator_arg_t,
4841 explicit variant(bsl::allocator_arg_t,
4865 explicit variant(bsl::allocator_arg_t,
4896#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
4912 template <
class t_TYPE,
4914 class =
typename bsl::enable_if_t<
4916 std::is_constructible<t_TYPE,
t_ARGS...>::value> >
4924 std::forward<t_ARGS>(
args)...);
4926 return bsl::get<index>(*
this);
4944 template <
class t_TYPE,
4947 class =
typename bsl::enable_if_t<
4949 std::is_constructible<t_TYPE,
4950 std::initializer_list<INIT_LIST_TYPE>&,
4959 il, std::forward<t_ARGS>(
args)...);
4961 return bsl::get<index>(*
this);
4981 class =
typename bsl::enable_if_t<
4982 (
t_INDEX < 1 +
sizeof...(t_TAIL)) &&
4992 std::forward<t_ARGS>(
args)...);
4994 return bsl::get<t_INDEX>(*
this);
5016 class =
typename bsl::enable_if_t<
5017 (
t_INDEX < 1 +
sizeof...(t_TAIL)) &&
5019 std::initializer_list<INIT_LIST_TYPE>&,
5028 il, std::forward<t_ARGS>(
args)...);
5030 return bsl::get<t_INDEX>(*
this);
5035 template <
class t_TYPE>
5037 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5052 template <
class t_TYPE,
class t_ARG_01>
5054 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5058 template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02>
5060 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5064 template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
5066 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5072 template <
class t_TYPE,
5078 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5085 template <
class t_TYPE,
5092 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5100 template <
class t_TYPE,
5108 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5117 template <
class t_TYPE,
5126 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5136 template <
class t_TYPE,
5146 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5157 template <
class t_TYPE,
5168 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5180 template <
class t_TYPE,
5192 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, variant>::value,
5216 template <
size_t t_INDEX>
5231 template <
size_t t_INDEX,
class t_ARG_01>
5235 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
5239 template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
5378#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
5440 template <
class t_TYPE>
5442 BloombergLP::bslstl::Variant_AssignsFromType<variant, t_TYPE>::value,
5453 bsl::get<altIndex>(*
this) = std::forward<t_TYPE>(value);
5459 std::forward<t_TYPE>(value));
5487 template <
class t_TYPE>
5489 BloombergLP::bslstl::Variant_AssignsFromType<variant, t_TYPE>::value,
5526#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
5528 Variant_UsesBslmaAllocatorAny<
t_HEAD,
t_TAIL...>::value,
5529 class =
typename bsl::enable_if_t<t_USES_BSLMA_ALLOC> >
5581template <
class t_RET,
class t_VARIANT_UNION>
5582t_RET& Variant_ImpUtil::getAlternative(
5586 return variantUnion.d_head.value();
5589template <
class t_RET,
size_t t_INDEX,
class t_VARIANT_UNION>
5590t_RET& Variant_ImpUtil::getAlternative(
5595 variantUnion.d_tail);
5598template <
class t_RET,
size_t t_INDEX,
class t_VARIANT>
5599t_RET& Variant_ImpUtil::get(t_VARIANT& variant)
5601 if (variant.index() != t_INDEX) {
5609template <
class t_RET,
size_t t_INDEX,
class t_VARIANT>
5610t_RET& Variant_ImpUtil::get(
const t_VARIANT& variant)
5612 if (variant.index() != t_INDEX) {
5620#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
5621template <
class t_RET,
class t_VISITOR,
class t_VARIANT>
5622t_RET Variant_ImpUtil::visit(t_VISITOR&& visitor, t_VARIANT&& variant)
5624 static constexpr size_t varSize =
5631 bslmf::MakeIntegerSequence<std::size_t, varSize> >::FuncPtr FuncPtr;
5639 bslmf::MakeIntegerSequence<std::size_t, varSize> >::
5640 s_map[variant.index()];
5642 return (*funcPtr)(std::forward<t_VISITOR>(visitor),
5643 std::forward<t_VARIANT>(variant));
5645template <
class t_RET,
class t_VISITOR,
class t_VARIANT>
5646t_RET Variant_ImpUtil::visitId(t_VISITOR&& visitor, t_VARIANT&& variant)
5648 static constexpr size_t varSize =
5651 typedef typename Variant_VTableId<
5655 bslmf::MakeIntegerSequence<std::size_t, varSize> >::FuncPtr FuncPtr;
5658 Variant_VTableId<t_RET,
5661 bslmf::MakeIntegerSequence<std::size_t, varSize> >::
5662 s_mapId[variant.index()];
5664 return (*funcPtr)(std::forward<t_VISITOR>(visitor),
5665 std::forward<t_VARIANT>(variant));
5669template <
class t_RET,
size_t t_INDEX,
class t_VARIANT>
5670t_RET& Variant_ImpUtil::unsafeGet(t_VARIANT& variant)
5676template <
class t_RET,
size_t t_INDEX,
class t_VARIANT>
5677t_RET& Variant_ImpUtil::unsafeGet(
const t_VARIANT& variant)
5683template <
class t_TYPE,
class t_VARIANT>
5684t_TYPE& Variant_ImpUtil::unsafeGet(t_VARIANT& obj)
5686 return unsafeGet<t_TYPE, BSLSTL_VARIANT_INDEX_OF(t_TYPE, t_VARIANT)>(
5690template <
class t_TYPE,
class t_VARIANT>
5691const t_TYPE& Variant_ImpUtil::unsafeGet(
const t_VARIANT& obj)
5693 return unsafeGet<const t_TYPE, BSLSTL_VARIANT_INDEX_OF(t_TYPE, t_VARIANT)>(
5697template <
class t_RET,
class t_VISITOR,
class t_VARIANT>
5698t_RET Variant_ImpUtil::visit(t_VISITOR& visitor, t_VARIANT& variant)
5708 return (*funcPtr)(visitor, variant);
5711template <
class t_RET,
class t_VISITOR,
class t_VARIANT>
5712t_RET Variant_ImpUtil::visit(t_VISITOR& visitor,
const t_VARIANT& variant)
5723 return (*funcPtr)(visitor, variant);
5726template <
class t_RET,
class t_VISITOR,
class t_VARIANT>
5727t_RET Variant_ImpUtil::moveVisit(t_VISITOR& visitor, t_VARIANT& variant)
5738 return (*funcPtr)(visitor, variant);
5745template <
class t_RET,
class t_VISITOR,
class t_VARIANT>
5746t_RET Variant_ImpUtil::visitId(t_VISITOR& visitor, t_VARIANT& variant)
5754 return (*funcPtr)(visitor, variant);
5757template <
class t_RET,
class t_VISITOR,
class t_VARIANT>
5758t_RET Variant_ImpUtil::visitId(t_VISITOR& visitor,
const t_VARIANT& variant)
5764 mapId()[variant.index()];
5766 return (*funcPtr)(visitor, variant);
5771#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
5776template <
class t_VARIANT,
class t_STD_VARIANT>
5777Variant_ImpUtil::ConstructFromStdVisitor<t_VARIANT, t_STD_VARIANT>::
5778 ConstructFromStdVisitor(t_VARIANT& target, t_STD_VARIANT& original)
5780, d_original(original)
5784template <
class t_VARIANT,
class t_STD_VARIANT>
5785template <
size_t t_INDEX,
class t_TYPE>
5787Variant_ImpUtil::ConstructFromStdVisitor<t_VARIANT, t_STD_VARIANT>::
5798 d_target.template baseEmplace<t_INDEX>(
5799 std::get<t_INDEX>(std::forward<t_STD_VARIANT>(d_original)));
5818#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
5820template <
class t_TYPE>
5821template <
class... t_ARGS>
5825 BloombergLP::bslma::ConstructionUtil::construct(
5826 d_buffer.address(), std::forward<t_ARGS>(args)...);
5831#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
5832template <
class t_TYPE>
5836 return d_buffer.object();
5839template <
class t_TYPE>
5843 return std::move(d_buffer.object());
5846template <
class t_TYPE>
5850 return d_buffer.object();
5855#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
5856template <
class t_TYPE>
5861 return d_buffer.object();
5864template <
class t_TYPE>
5869 return std::move(d_buffer.object());
5872template <
class t_TYPE>
5876 return d_buffer.object();
5883template <
class t_VARIANT>
5886 if (lhs.get_allocator() == rhs.get_allocator()) {
5891 t_VARIANT futureLhs(bsl::allocator_arg, lhs.get_allocator(), rhs);
5892 t_VARIANT futureRhs(bsl::allocator_arg, rhs.get_allocator(), lhs);
5894 futureLhs.swap(lhs);
5895 futureRhs.swap(rhs);
5901template <
class t_VARIANT>
5912#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
5913template <
class t_HEAD,
class... t_TAIL>
5918, d_union(
bsl::in_place_index_t<0>(), AllocBase::mechanism())
5922template <
class t_HEAD,
class... t_TAIL>
5924Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(
const Variant_Base& original)
5929 BloombergLP::bslstl::Variant_CopyConstructVisitor<Variant_Base>
5930 copyConstructor(
this);
5932 void, copyConstructor,
static_cast<const Variant&
>(original));
5936template <
class t_HEAD,
class... t_TAIL>
5938Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(Variant_Base&& original)
5939: AllocBase(original)
5943 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
5944 moveConstructor(
this);
5946 void, moveConstructor,
static_cast<Variant&
>(original));
5950#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
5951template <
class t_HEAD,
class... t_TAIL>
5952Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(Variant_ConstructFromStdTag,
5960template <
class t_HEAD,
class... t_TAIL>
5962Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(bsl::allocator_arg_t,
5963 allocator_type allocator)
5964: AllocBase(allocator)
5966, d_union(
bsl::in_place_index_t<0>(), AllocBase::mechanism())
5970template <
class t_HEAD,
class... t_TAIL>
5972Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(bsl::allocator_arg_t,
5973 allocator_type allocator,
5974 const Variant& original)
5975: AllocBase(allocator)
5979 BloombergLP::bslstl::Variant_CopyConstructVisitor<Variant_Base>
5980 copyConstructor(
this);
5985template <
class t_HEAD,
class... t_TAIL>
5987Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(bsl::allocator_arg_t,
5988 allocator_type allocator,
5990: AllocBase(allocator)
5994 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
5995 moveConstructor(
this);
6000#ifdef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
6001template <
class t_HEAD,
class... t_TAIL>
6002Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(bsl::allocator_arg_t,
6003 allocator_type allocator,
6004 Variant_ConstructFromStdTag,
6006: AllocBase(allocator)
6012template <
class t_HEAD,
class... t_TAIL>
6013template <
size_t t_INDEX,
class... t_ARGS>
6018, d_union(
bsl::in_place_index_t<t_INDEX>(),
6019 AllocBase::mechanism(),
6020 std::forward<t_ARGS>(args)...)
6024template <
class t_HEAD,
class... t_TAIL>
6025template <
size_t t_INDEX,
class... t_ARGS>
6027Variant_Base<t_HEAD, t_TAIL...>::Variant_Base(bsl::allocator_arg_t,
6028 allocator_type allocator,
6031: AllocBase(allocator)
6033, d_union(
bsl::in_place_index_t<t_INDEX>(),
6034 AllocBase::mechanism(),
6035 std::forward<t_ARGS>(args)...)
6039#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
6040template <
class t_HEAD,
class... t_TAIL>
6048 BloombergLP::bslma::ConstructionUtil::construct(
6050 AllocBase::mechanism());
6053template <
class t_HEAD,
class... t_TAIL>
6057, d_type(
bsl::variant_npos)
6060 BloombergLP::bslstl::Variant_CopyConstructVisitor<Variant_Base>
6061 copyConstructor(
this);
6066 d_type = original.d_type;
6070template <
class t_HEAD,
class... t_TAIL>
6073 BloombergLP::bslmf::MovableRef<Variant> original)
6075, d_type(
bsl::variant_npos)
6079 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
6080 moveConstructor(
this);
6089template <
class t_HEAD,
class... t_TAIL>
6090template <
size_t t_INDEX>
6100 BloombergLP::bslma::ConstructionUtil::construct(
6102 AllocBase::mechanism());
6105template <
class t_HEAD,
class... t_TAIL>
6106template <
size_t t_INDEX,
class t_ARG_01>
6110 const t_ARG_01& arg_01)
6118 BloombergLP::bslma::ConstructionUtil::construct(
6120 AllocBase::mechanism(),
6124template <
class t_HEAD,
class... t_TAIL>
6125template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
6129 const t_ARG_01& arg_01,
6130 const t_ARG_02& arg_02)
6138 BloombergLP::bslma::ConstructionUtil::construct(
6140 AllocBase::mechanism(),
6145template <
class t_HEAD,
class... t_TAIL>
6146template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
6150 const t_ARG_01& arg_01,
6151 const t_ARG_02& arg_02,
6152 const t_ARG_03& arg_03)
6160 BloombergLP::bslma::ConstructionUtil::construct(
6162 AllocBase::mechanism(),
6168template <
class t_HEAD,
class... t_TAIL>
6169template <
size_t t_INDEX,
6176 const t_ARG_01& arg_01,
6177 const t_ARG_02& arg_02,
6178 const t_ARG_03& arg_03,
6179 const t_ARG_04& arg_04)
6187 BloombergLP::bslma::ConstructionUtil::construct(
6189 AllocBase::mechanism(),
6196template <
class t_HEAD,
class... t_TAIL>
6197template <
size_t t_INDEX,
6205 const t_ARG_01& arg_01,
6206 const t_ARG_02& arg_02,
6207 const t_ARG_03& arg_03,
6208 const t_ARG_04& arg_04,
6209 const t_ARG_05& arg_05)
6217 BloombergLP::bslma::ConstructionUtil::construct(
6219 AllocBase::mechanism(),
6227template <
class t_HEAD,
class... t_TAIL>
6228template <
size_t t_INDEX,
6237 const t_ARG_01& arg_01,
6238 const t_ARG_02& arg_02,
6239 const t_ARG_03& arg_03,
6240 const t_ARG_04& arg_04,
6241 const t_ARG_05& arg_05,
6242 const t_ARG_06& arg_06)
6250 BloombergLP::bslma::ConstructionUtil::construct(
6252 AllocBase::mechanism(),
6261template <
class t_HEAD,
class... t_TAIL>
6262template <
size_t t_INDEX,
6272 const t_ARG_01& arg_01,
6273 const t_ARG_02& arg_02,
6274 const t_ARG_03& arg_03,
6275 const t_ARG_04& arg_04,
6276 const t_ARG_05& arg_05,
6277 const t_ARG_06& arg_06,
6278 const t_ARG_07& arg_07)
6286 BloombergLP::bslma::ConstructionUtil::construct(
6288 AllocBase::mechanism(),
6298template <
class t_HEAD,
class... t_TAIL>
6299template <
size_t t_INDEX,
6310 const t_ARG_01& arg_01,
6311 const t_ARG_02& arg_02,
6312 const t_ARG_03& arg_03,
6313 const t_ARG_04& arg_04,
6314 const t_ARG_05& arg_05,
6315 const t_ARG_06& arg_06,
6316 const t_ARG_07& arg_07,
6317 const t_ARG_08& arg_08)
6325 BloombergLP::bslma::ConstructionUtil::construct(
6327 AllocBase::mechanism(),
6338template <
class t_HEAD,
class... t_TAIL>
6339template <
size_t t_INDEX,
6351 const t_ARG_01& arg_01,
6352 const t_ARG_02& arg_02,
6353 const t_ARG_03& arg_03,
6354 const t_ARG_04& arg_04,
6355 const t_ARG_05& arg_05,
6356 const t_ARG_06& arg_06,
6357 const t_ARG_07& arg_07,
6358 const t_ARG_08& arg_08,
6359 const t_ARG_09& arg_09)
6367 BloombergLP::bslma::ConstructionUtil::construct(
6369 AllocBase::mechanism(),
6381template <
class t_HEAD,
class... t_TAIL>
6382template <
size_t t_INDEX,
6395 const t_ARG_01& arg_01,
6396 const t_ARG_02& arg_02,
6397 const t_ARG_03& arg_03,
6398 const t_ARG_04& arg_04,
6399 const t_ARG_05& arg_05,
6400 const t_ARG_06& arg_06,
6401 const t_ARG_07& arg_07,
6402 const t_ARG_08& arg_08,
6403 const t_ARG_09& arg_09,
6404 const t_ARG_10& arg_10)
6412 BloombergLP::bslma::ConstructionUtil::construct(
6414 AllocBase::mechanism(),
6427template <
class t_HEAD,
class... t_TAIL>
6434 BloombergLP::bslma::ConstructionUtil::construct(
6436 AllocBase::mechanism());
6439template <
class t_HEAD,
class... t_TAIL>
6445, d_type(
bsl::variant_npos)
6448 BloombergLP::bslstl::Variant_CopyConstructVisitor<Variant_Base>
6449 copyConstructor(
this);
6455 d_type = original.d_type;
6459template <
class t_HEAD,
class... t_TAIL>
6462 bsl::allocator_arg_t,
6464 BloombergLP::bslmf::MovableRef<Variant> original)
6466, d_type(
bsl::variant_npos)
6470 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
6471 moveConstructor(
this);
6481template <
class t_HEAD,
class... t_TAIL>
6482template <
size_t t_INDEX>
6485 bsl::allocator_arg_t,
6495 BloombergLP::bslma::ConstructionUtil::construct(
6497 AllocBase::mechanism());
6500template <
class t_HEAD,
class... t_TAIL>
6501template <
size_t t_INDEX,
class t_ARG_01>
6504 bsl::allocator_arg_t,
6507 const t_ARG_01& arg_01)
6515 BloombergLP::bslma::ConstructionUtil::construct(
6517 AllocBase::mechanism(),
6521template <
class t_HEAD,
class... t_TAIL>
6522template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
6525 bsl::allocator_arg_t,
6528 const t_ARG_01& arg_01,
6529 const t_ARG_02& arg_02)
6537 BloombergLP::bslma::ConstructionUtil::construct(
6539 AllocBase::mechanism(),
6544template <
class t_HEAD,
class... t_TAIL>
6545template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
6548 bsl::allocator_arg_t,
6551 const t_ARG_01& arg_01,
6552 const t_ARG_02& arg_02,
6553 const t_ARG_03& arg_03)
6561 BloombergLP::bslma::ConstructionUtil::construct(
6563 AllocBase::mechanism(),
6569template <
class t_HEAD,
class... t_TAIL>
6570template <
size_t t_INDEX,
6579 const t_ARG_01& arg_01,
6580 const t_ARG_02& arg_02,
6581 const t_ARG_03& arg_03,
6582 const t_ARG_04& arg_04)
6590 BloombergLP::bslma::ConstructionUtil::construct(
6592 AllocBase::mechanism(),
6599template <
class t_HEAD,
class... t_TAIL>
6600template <
size_t t_INDEX,
6610 const t_ARG_01& arg_01,
6611 const t_ARG_02& arg_02,
6612 const t_ARG_03& arg_03,
6613 const t_ARG_04& arg_04,
6614 const t_ARG_05& arg_05)
6622 BloombergLP::bslma::ConstructionUtil::construct(
6624 AllocBase::mechanism(),
6632template <
class t_HEAD,
class... t_TAIL>
6633template <
size_t t_INDEX,
6644 const t_ARG_01& arg_01,
6645 const t_ARG_02& arg_02,
6646 const t_ARG_03& arg_03,
6647 const t_ARG_04& arg_04,
6648 const t_ARG_05& arg_05,
6649 const t_ARG_06& arg_06)
6657 BloombergLP::bslma::ConstructionUtil::construct(
6659 AllocBase::mechanism(),
6668template <
class t_HEAD,
class... t_TAIL>
6669template <
size_t t_INDEX,
6681 const t_ARG_01& arg_01,
6682 const t_ARG_02& arg_02,
6683 const t_ARG_03& arg_03,
6684 const t_ARG_04& arg_04,
6685 const t_ARG_05& arg_05,
6686 const t_ARG_06& arg_06,
6687 const t_ARG_07& arg_07)
6695 BloombergLP::bslma::ConstructionUtil::construct(
6697 AllocBase::mechanism(),
6707template <
class t_HEAD,
class... t_TAIL>
6708template <
size_t t_INDEX,
6721 const t_ARG_01& arg_01,
6722 const t_ARG_02& arg_02,
6723 const t_ARG_03& arg_03,
6724 const t_ARG_04& arg_04,
6725 const t_ARG_05& arg_05,
6726 const t_ARG_06& arg_06,
6727 const t_ARG_07& arg_07,
6728 const t_ARG_08& arg_08)
6736 BloombergLP::bslma::ConstructionUtil::construct(
6738 AllocBase::mechanism(),
6749template <
class t_HEAD,
class... t_TAIL>
6750template <
size_t t_INDEX,
6764 const t_ARG_01& arg_01,
6765 const t_ARG_02& arg_02,
6766 const t_ARG_03& arg_03,
6767 const t_ARG_04& arg_04,
6768 const t_ARG_05& arg_05,
6769 const t_ARG_06& arg_06,
6770 const t_ARG_07& arg_07,
6771 const t_ARG_08& arg_08,
6772 const t_ARG_09& arg_09)
6780 BloombergLP::bslma::ConstructionUtil::construct(
6782 AllocBase::mechanism(),
6794template <
class t_HEAD,
class... t_TAIL>
6795template <
size_t t_INDEX,
6810 const t_ARG_01& arg_01,
6811 const t_ARG_02& arg_02,
6812 const t_ARG_03& arg_03,
6813 const t_ARG_04& arg_04,
6814 const t_ARG_05& arg_05,
6815 const t_ARG_06& arg_06,
6816 const t_ARG_07& arg_07,
6817 const t_ARG_08& arg_08,
6818 const t_ARG_09& arg_09,
6819 const t_ARG_10& arg_10)
6827 BloombergLP::bslma::ConstructionUtil::construct(
6829 AllocBase::mechanism(),
6844#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
6845template <
class t_HEAD,
class... t_TAIL>
6852#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
6853template <
class t_HEAD,
class... t_TAIL>
6854template <
size_t t_INDEX,
class... t_ARGS>
6869 BloombergLP::bslma::ConstructionUtil::construct(
6873 AllocBase::mechanism(),
6874 std::forward<t_ARGS>(args)...);
6879#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
6880template <
class t_HEAD,
class... t_TAIL>
6881template <
size_t t_INDEX>
6890 BloombergLP::bslma::ConstructionUtil::construct(
6892 AllocBase::mechanism());
6896template <
class t_HEAD,
class... t_TAIL>
6897template <
size_t t_INDEX,
class t_ARG_01>
6906 BloombergLP::bslma::ConstructionUtil::construct(
6908 AllocBase::mechanism(),
6913template <
class t_HEAD,
class... t_TAIL>
6914template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
6916 const t_ARG_02& arg_02)
6924 BloombergLP::bslma::ConstructionUtil::construct(
6926 AllocBase::mechanism(),
6932template <
class t_HEAD,
class... t_TAIL>
6933template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
6935 const t_ARG_02& arg_02,
6936 const t_ARG_03& arg_03)
6944 BloombergLP::bslma::ConstructionUtil::construct(
6946 AllocBase::mechanism(),
6953template <
class t_HEAD,
class... t_TAIL>
6954template <
size_t t_INDEX,
6960 const t_ARG_02& arg_02,
6961 const t_ARG_03& arg_03,
6962 const t_ARG_04& arg_04)
6970 BloombergLP::bslma::ConstructionUtil::construct(
6972 AllocBase::mechanism(),
6980template <
class t_HEAD,
class... t_TAIL>
6981template <
size_t t_INDEX,
6988 const t_ARG_02& arg_02,
6989 const t_ARG_03& arg_03,
6990 const t_ARG_04& arg_04,
6991 const t_ARG_05& arg_05)
6999 BloombergLP::bslma::ConstructionUtil::construct(
7001 AllocBase::mechanism(),
7010template <
class t_HEAD,
class... t_TAIL>
7011template <
size_t t_INDEX,
7019 const t_ARG_02& arg_02,
7020 const t_ARG_03& arg_03,
7021 const t_ARG_04& arg_04,
7022 const t_ARG_05& arg_05,
7023 const t_ARG_06& arg_06)
7031 BloombergLP::bslma::ConstructionUtil::construct(
7033 AllocBase::mechanism(),
7043template <
class t_HEAD,
class... t_TAIL>
7044template <
size_t t_INDEX,
7053 const t_ARG_02& arg_02,
7054 const t_ARG_03& arg_03,
7055 const t_ARG_04& arg_04,
7056 const t_ARG_05& arg_05,
7057 const t_ARG_06& arg_06,
7058 const t_ARG_07& arg_07)
7066 BloombergLP::bslma::ConstructionUtil::construct(
7068 AllocBase::mechanism(),
7079template <
class t_HEAD,
class... t_TAIL>
7080template <
size_t t_INDEX,
7090 const t_ARG_02& arg_02,
7091 const t_ARG_03& arg_03,
7092 const t_ARG_04& arg_04,
7093 const t_ARG_05& arg_05,
7094 const t_ARG_06& arg_06,
7095 const t_ARG_07& arg_07,
7096 const t_ARG_08& arg_08)
7104 BloombergLP::bslma::ConstructionUtil::construct(
7106 AllocBase::mechanism(),
7118template <
class t_HEAD,
class... t_TAIL>
7119template <
size_t t_INDEX,
7130 const t_ARG_02& arg_02,
7131 const t_ARG_03& arg_03,
7132 const t_ARG_04& arg_04,
7133 const t_ARG_05& arg_05,
7134 const t_ARG_06& arg_06,
7135 const t_ARG_07& arg_07,
7136 const t_ARG_08& arg_08,
7137 const t_ARG_09& arg_09)
7145 BloombergLP::bslma::ConstructionUtil::construct(
7147 AllocBase::mechanism(),
7160template <
class t_HEAD,
class... t_TAIL>
7161template <
size_t t_INDEX,
7173 const t_ARG_02& arg_02,
7174 const t_ARG_03& arg_03,
7175 const t_ARG_04& arg_04,
7176 const t_ARG_05& arg_05,
7177 const t_ARG_06& arg_06,
7178 const t_ARG_07& arg_07,
7179 const t_ARG_08& arg_08,
7180 const t_ARG_09& arg_09,
7181 const t_ARG_10& arg_10)
7189 BloombergLP::bslma::ConstructionUtil::construct(
7191 AllocBase::mechanism(),
7207#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
7208template <
class t_HEAD,
class... t_TAIL>
7214 if (this->d_type == rhs.
d_type) {
7217 BloombergLP::bslstl::Variant_CopyAssignVisitor<Variant>
7220 void, copyAssign,
static_cast<const Variant&
>(rhs));
7226 BloombergLP::bslstl::Variant_CopyConstructVisitor<Variant_Base>
7227 copyConstructor(
this);
7229 void, copyConstructor,
static_cast<const Variant&
>(rhs));
7237template <
class t_HEAD,
class... t_TAIL>
7240 BloombergLP::bslmf::MovableRef<Variant_Base> rhs)
7243 if (&lvalue !=
this) {
7244 if (this->d_type == lvalue.
d_type) {
7247 BloombergLP::bslstl::Variant_MoveAssignVisitor<Variant>
7250 void, moveAssign,
static_cast<Variant&
>(lvalue));
7256 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
7257 moveConstructor(
this);
7259 void, moveConstructor,
static_cast<Variant&
>(lvalue));
7266template <
class t_HEAD,
class... t_TAIL>
7270 BloombergLP::bslstl::Variant_DestructorVisitor destructor;
7286#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
7287template <
class t_HEAD,
class... t_TAIL>
7288template <
class t_TYPE>
7290variant<t_HEAD, t_TAIL...>::variant(
7296 std::forward<t_TYPE>(value))
7300template <
class t_HEAD,
class... t_TAIL>
7301template <
class t_TYPE>
7303variant<t_HEAD, t_TAIL...>::variant(
7304 bsl::allocator_arg_t,
7305 allocator_type allocator,
7309 bsl::allocator_arg_t{},
7313 std::forward<t_TYPE>(value))
7317#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
7318template <
class t_HEAD,
class... t_TAIL>
7325template <
class t_HEAD,
class... t_TAIL>
7328: Variant_Base(original)
7332template <
class t_HEAD,
class... t_TAIL>
7335 BloombergLP::bslmf::MovableRef<variant> original)
7336: Variant_Base(original)
7340template <
class t_HEAD,
class... t_TAIL>
7341template <
class t_TYPE>
7344 const t_TYPE& value,
7353template <
class t_HEAD,
class... t_TAIL>
7354template <
class t_TYPE>
7364template <
class t_HEAD,
class... t_TAIL>
7365template <
class t_TYPE,
class t_ARG_01>
7369 const t_ARG_01& arg_01,
7377template <
class t_HEAD,
class... t_TAIL>
7378template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02>
7382 const t_ARG_01& arg_01,
7383 const t_ARG_02& arg_02,
7392template <
class t_HEAD,
class... t_TAIL>
7393template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
7397 const t_ARG_01& arg_01,
7398 const t_ARG_02& arg_02,
7399 const t_ARG_03& arg_03,
7409template <
class t_HEAD,
class... t_TAIL>
7410template <
class t_TYPE,
7418 const t_ARG_01& arg_01,
7419 const t_ARG_02& arg_02,
7420 const t_ARG_03& arg_03,
7421 const t_ARG_04& arg_04,
7432template <
class t_HEAD,
class... t_TAIL>
7433template <
class t_TYPE,
7442 const t_ARG_01& arg_01,
7443 const t_ARG_02& arg_02,
7444 const t_ARG_03& arg_03,
7445 const t_ARG_04& arg_04,
7446 const t_ARG_05& arg_05,
7458template <
class t_HEAD,
class... t_TAIL>
7459template <
class t_TYPE,
7469 const t_ARG_01& arg_01,
7470 const t_ARG_02& arg_02,
7471 const t_ARG_03& arg_03,
7472 const t_ARG_04& arg_04,
7473 const t_ARG_05& arg_05,
7474 const t_ARG_06& arg_06,
7487template <
class t_HEAD,
class... t_TAIL>
7488template <
class t_TYPE,
7499 const t_ARG_01& arg_01,
7500 const t_ARG_02& arg_02,
7501 const t_ARG_03& arg_03,
7502 const t_ARG_04& arg_04,
7503 const t_ARG_05& arg_05,
7504 const t_ARG_06& arg_06,
7505 const t_ARG_07& arg_07,
7519template <
class t_HEAD,
class... t_TAIL>
7520template <
class t_TYPE,
7532 const t_ARG_01& arg_01,
7533 const t_ARG_02& arg_02,
7534 const t_ARG_03& arg_03,
7535 const t_ARG_04& arg_04,
7536 const t_ARG_05& arg_05,
7537 const t_ARG_06& arg_06,
7538 const t_ARG_07& arg_07,
7539 const t_ARG_08& arg_08,
7554template <
class t_HEAD,
class... t_TAIL>
7555template <
class t_TYPE,
7568 const t_ARG_01& arg_01,
7569 const t_ARG_02& arg_02,
7570 const t_ARG_03& arg_03,
7571 const t_ARG_04& arg_04,
7572 const t_ARG_05& arg_05,
7573 const t_ARG_06& arg_06,
7574 const t_ARG_07& arg_07,
7575 const t_ARG_08& arg_08,
7576 const t_ARG_09& arg_09,
7592template <
class t_HEAD,
class... t_TAIL>
7593template <
class t_TYPE,
7607 const t_ARG_01& arg_01,
7608 const t_ARG_02& arg_02,
7609 const t_ARG_03& arg_03,
7610 const t_ARG_04& arg_04,
7611 const t_ARG_05& arg_05,
7612 const t_ARG_06& arg_06,
7613 const t_ARG_07& arg_07,
7614 const t_ARG_08& arg_08,
7615 const t_ARG_09& arg_09,
7616 const t_ARG_10& arg_10,
7633template <
class t_HEAD,
class... t_TAIL>
7634template <
size_t t_INDEX>
7641template <
class t_HEAD,
class... t_TAIL>
7642template <
size_t t_INDEX,
class t_ARG_01>
7645 const t_ARG_01& arg_01)
7650template <
class t_HEAD,
class... t_TAIL>
7651template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
7654 const t_ARG_01& arg_01,
7655 const t_ARG_02& arg_02)
7660template <
class t_HEAD,
class... t_TAIL>
7661template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
7664 const t_ARG_01& arg_01,
7665 const t_ARG_02& arg_02,
7666 const t_ARG_03& arg_03)
7671template <
class t_HEAD,
class... t_TAIL>
7672template <
size_t t_INDEX,
7679 const t_ARG_01& arg_01,
7680 const t_ARG_02& arg_02,
7681 const t_ARG_03& arg_03,
7682 const t_ARG_04& arg_04)
7691template <
class t_HEAD,
class... t_TAIL>
7692template <
size_t t_INDEX,
7700 const t_ARG_01& arg_01,
7701 const t_ARG_02& arg_02,
7702 const t_ARG_03& arg_03,
7703 const t_ARG_04& arg_04,
7704 const t_ARG_05& arg_05)
7714template <
class t_HEAD,
class... t_TAIL>
7715template <
size_t t_INDEX,
7724 const t_ARG_01& arg_01,
7725 const t_ARG_02& arg_02,
7726 const t_ARG_03& arg_03,
7727 const t_ARG_04& arg_04,
7728 const t_ARG_05& arg_05,
7729 const t_ARG_06& arg_06)
7740template <
class t_HEAD,
class... t_TAIL>
7741template <
size_t t_INDEX,
7751 const t_ARG_01& arg_01,
7752 const t_ARG_02& arg_02,
7753 const t_ARG_03& arg_03,
7754 const t_ARG_04& arg_04,
7755 const t_ARG_05& arg_05,
7756 const t_ARG_06& arg_06,
7757 const t_ARG_07& arg_07)
7769template <
class t_HEAD,
class... t_TAIL>
7770template <
size_t t_INDEX,
7781 const t_ARG_01& arg_01,
7782 const t_ARG_02& arg_02,
7783 const t_ARG_03& arg_03,
7784 const t_ARG_04& arg_04,
7785 const t_ARG_05& arg_05,
7786 const t_ARG_06& arg_06,
7787 const t_ARG_07& arg_07,
7788 const t_ARG_08& arg_08)
7801template <
class t_HEAD,
class... t_TAIL>
7802template <
size_t t_INDEX,
7814 const t_ARG_01& arg_01,
7815 const t_ARG_02& arg_02,
7816 const t_ARG_03& arg_03,
7817 const t_ARG_04& arg_04,
7818 const t_ARG_05& arg_05,
7819 const t_ARG_06& arg_06,
7820 const t_ARG_07& arg_07,
7821 const t_ARG_08& arg_08,
7822 const t_ARG_09& arg_09)
7836template <
class t_HEAD,
class... t_TAIL>
7837template <
size_t t_INDEX,
7850 const t_ARG_01& arg_01,
7851 const t_ARG_02& arg_02,
7852 const t_ARG_03& arg_03,
7853 const t_ARG_04& arg_04,
7854 const t_ARG_05& arg_05,
7855 const t_ARG_06& arg_06,
7856 const t_ARG_07& arg_07,
7857 const t_ARG_08& arg_08,
7858 const t_ARG_09& arg_09,
7859 const t_ARG_10& arg_10)
7874template <
class t_HEAD,
class... t_TAIL>
7882template <
class t_HEAD,
class... t_TAIL>
7887: Variant_Base(
bsl::allocator_arg_t(),
allocator, original)
7891template <
class t_HEAD,
class... t_TAIL>
7894 bsl::allocator_arg_t,
7896 BloombergLP::bslmf::MovableRef<variant> original)
7897: Variant_Base(
bsl::allocator_arg_t(),
allocator, original)
7901template <
class t_HEAD,
class... t_TAIL>
7902template <
class t_TYPE>
7905 bsl::allocator_arg_t,
7907 const t_TYPE& value,
7910 bsl::allocator_arg_t(),
7918template <
class t_HEAD,
class... t_TAIL>
7919template <
class t_TYPE>
7922 bsl::allocator_arg_t,
7927 bsl::allocator_arg_t(),
7933template <
class t_HEAD,
class... t_TAIL>
7934template <
class t_TYPE,
class t_ARG_01>
7937 bsl::allocator_arg_t,
7940 const t_ARG_01& arg_01,
7943 bsl::allocator_arg_t(),
7950template <
class t_HEAD,
class... t_TAIL>
7951template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02>
7954 bsl::allocator_arg_t,
7957 const t_ARG_01& arg_01,
7958 const t_ARG_02& arg_02,
7961 bsl::allocator_arg_t(),
7969template <
class t_HEAD,
class... t_TAIL>
7970template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
7973 bsl::allocator_arg_t,
7976 const t_ARG_01& arg_01,
7977 const t_ARG_02& arg_02,
7978 const t_ARG_03& arg_03,
7981 bsl::allocator_arg_t(),
7990template <
class t_HEAD,
class... t_TAIL>
7991template <
class t_TYPE,
7998 bsl::allocator_arg_t,
8001 const t_ARG_01& arg_01,
8002 const t_ARG_02& arg_02,
8003 const t_ARG_03& arg_03,
8004 const t_ARG_04& arg_04,
8007 bsl::allocator_arg_t(),
8017template <
class t_HEAD,
class... t_TAIL>
8018template <
class t_TYPE,
8026 bsl::allocator_arg_t,
8029 const t_ARG_01& arg_01,
8030 const t_ARG_02& arg_02,
8031 const t_ARG_03& arg_03,
8032 const t_ARG_04& arg_04,
8033 const t_ARG_05& arg_05,
8036 bsl::allocator_arg_t(),
8047template <
class t_HEAD,
class... t_TAIL>
8048template <
class t_TYPE,
8057 bsl::allocator_arg_t,
8060 const t_ARG_01& arg_01,
8061 const t_ARG_02& arg_02,
8062 const t_ARG_03& arg_03,
8063 const t_ARG_04& arg_04,
8064 const t_ARG_05& arg_05,
8065 const t_ARG_06& arg_06,
8068 bsl::allocator_arg_t(),
8080template <
class t_HEAD,
class... t_TAIL>
8081template <
class t_TYPE,
8091 bsl::allocator_arg_t,
8094 const t_ARG_01& arg_01,
8095 const t_ARG_02& arg_02,
8096 const t_ARG_03& arg_03,
8097 const t_ARG_04& arg_04,
8098 const t_ARG_05& arg_05,
8099 const t_ARG_06& arg_06,
8100 const t_ARG_07& arg_07,
8103 bsl::allocator_arg_t(),
8116template <
class t_HEAD,
class... t_TAIL>
8117template <
class t_TYPE,
8128 bsl::allocator_arg_t,
8131 const t_ARG_01& arg_01,
8132 const t_ARG_02& arg_02,
8133 const t_ARG_03& arg_03,
8134 const t_ARG_04& arg_04,
8135 const t_ARG_05& arg_05,
8136 const t_ARG_06& arg_06,
8137 const t_ARG_07& arg_07,
8138 const t_ARG_08& arg_08,
8141 bsl::allocator_arg_t(),
8155template <
class t_HEAD,
class... t_TAIL>
8156template <
class t_TYPE,
8168 bsl::allocator_arg_t,
8171 const t_ARG_01& arg_01,
8172 const t_ARG_02& arg_02,
8173 const t_ARG_03& arg_03,
8174 const t_ARG_04& arg_04,
8175 const t_ARG_05& arg_05,
8176 const t_ARG_06& arg_06,
8177 const t_ARG_07& arg_07,
8178 const t_ARG_08& arg_08,
8179 const t_ARG_09& arg_09,
8182 bsl::allocator_arg_t(),
8197template <
class t_HEAD,
class... t_TAIL>
8198template <
class t_TYPE,
8211 bsl::allocator_arg_t,
8214 const t_ARG_01& arg_01,
8215 const t_ARG_02& arg_02,
8216 const t_ARG_03& arg_03,
8217 const t_ARG_04& arg_04,
8218 const t_ARG_05& arg_05,
8219 const t_ARG_06& arg_06,
8220 const t_ARG_07& arg_07,
8221 const t_ARG_08& arg_08,
8222 const t_ARG_09& arg_09,
8223 const t_ARG_10& arg_10,
8226 bsl::allocator_arg_t(),
8242template <
class t_HEAD,
class... t_TAIL>
8243template <
size_t t_INDEX>
8248: Variant_Base(
bsl::allocator_arg_t(),
8254template <
class t_HEAD,
class... t_TAIL>
8255template <
size_t t_INDEX,
class t_ARG_01>
8260 const t_ARG_01& arg_01)
8261: Variant_Base(
bsl::allocator_arg_t(),
8268template <
class t_HEAD,
class... t_TAIL>
8269template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
8274 const t_ARG_01& arg_01,
8275 const t_ARG_02& arg_02)
8276: Variant_Base(
bsl::allocator_arg_t(),
8284template <
class t_HEAD,
class... t_TAIL>
8285template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
8290 const t_ARG_01& arg_01,
8291 const t_ARG_02& arg_02,
8292 const t_ARG_03& arg_03)
8293: Variant_Base(
bsl::allocator_arg_t(),
8302template <
class t_HEAD,
class... t_TAIL>
8303template <
size_t t_INDEX,
8312 const t_ARG_01& arg_01,
8313 const t_ARG_02& arg_02,
8314 const t_ARG_03& arg_03,
8315 const t_ARG_04& arg_04)
8316: Variant_Base(
bsl::allocator_arg_t(),
8326template <
class t_HEAD,
class... t_TAIL>
8327template <
size_t t_INDEX,
8337 const t_ARG_01& arg_01,
8338 const t_ARG_02& arg_02,
8339 const t_ARG_03& arg_03,
8340 const t_ARG_04& arg_04,
8341 const t_ARG_05& arg_05)
8342: Variant_Base(
bsl::allocator_arg_t(),
8353template <
class t_HEAD,
class... t_TAIL>
8354template <
size_t t_INDEX,
8365 const t_ARG_01& arg_01,
8366 const t_ARG_02& arg_02,
8367 const t_ARG_03& arg_03,
8368 const t_ARG_04& arg_04,
8369 const t_ARG_05& arg_05,
8370 const t_ARG_06& arg_06)
8371: Variant_Base(
bsl::allocator_arg_t(),
8383template <
class t_HEAD,
class... t_TAIL>
8384template <
size_t t_INDEX,
8396 const t_ARG_01& arg_01,
8397 const t_ARG_02& arg_02,
8398 const t_ARG_03& arg_03,
8399 const t_ARG_04& arg_04,
8400 const t_ARG_05& arg_05,
8401 const t_ARG_06& arg_06,
8402 const t_ARG_07& arg_07)
8403: Variant_Base(
bsl::allocator_arg_t(),
8416template <
class t_HEAD,
class... t_TAIL>
8417template <
size_t t_INDEX,
8430 const t_ARG_01& arg_01,
8431 const t_ARG_02& arg_02,
8432 const t_ARG_03& arg_03,
8433 const t_ARG_04& arg_04,
8434 const t_ARG_05& arg_05,
8435 const t_ARG_06& arg_06,
8436 const t_ARG_07& arg_07,
8437 const t_ARG_08& arg_08)
8438: Variant_Base(
bsl::allocator_arg_t(),
8452template <
class t_HEAD,
class... t_TAIL>
8453template <
size_t t_INDEX,
8467 const t_ARG_01& arg_01,
8468 const t_ARG_02& arg_02,
8469 const t_ARG_03& arg_03,
8470 const t_ARG_04& arg_04,
8471 const t_ARG_05& arg_05,
8472 const t_ARG_06& arg_06,
8473 const t_ARG_07& arg_07,
8474 const t_ARG_08& arg_08,
8475 const t_ARG_09& arg_09)
8476: Variant_Base(
bsl::allocator_arg_t(),
8491template <
class t_HEAD,
class... t_TAIL>
8492template <
size_t t_INDEX,
8507 const t_ARG_01& arg_01,
8508 const t_ARG_02& arg_02,
8509 const t_ARG_03& arg_03,
8510 const t_ARG_04& arg_04,
8511 const t_ARG_05& arg_05,
8512 const t_ARG_06& arg_06,
8513 const t_ARG_07& arg_07,
8514 const t_ARG_08& arg_08,
8515 const t_ARG_09& arg_09,
8516 const t_ARG_10& arg_10)
8517: Variant_Base(
bsl::allocator_arg_t(),
8533template <
class t_HEAD,
class... t_TAIL>
8534template <
class t_TYPE>
8535typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8537 variant<t_HEAD, t_TAIL...> >::value,
8543 Variant_Base::template baseEmplace<index>();
8545 return bsl::get<index>(*
this);
8548template <
class t_HEAD,
class... t_TAIL>
8549template <
class t_TYPE,
class t_ARG_01>
8550typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8552 variant<t_HEAD, t_TAIL...> >::value,
8558 Variant_Base::template baseEmplace<index>(arg_01);
8560 return bsl::get<index>(*
this);
8563template <
class t_HEAD,
class... t_TAIL>
8564template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02>
8565typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8567 variant<t_HEAD, t_TAIL...> >::value,
8570 const t_ARG_02& arg_02)
8574 Variant_Base::template baseEmplace<index>(arg_01, arg_02);
8576 return bsl::get<index>(*
this);
8579template <
class t_HEAD,
class... t_TAIL>
8580template <
class t_TYPE,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
8581typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8583 variant<t_HEAD, t_TAIL...> >::value,
8586 const t_ARG_02& arg_02,
8587 const t_ARG_03& arg_03)
8591 Variant_Base::template baseEmplace<index>(arg_01, arg_02, arg_03);
8593 return bsl::get<index>(*
this);
8596template <
class t_HEAD,
class... t_TAIL>
8597template <
class t_TYPE,
8602typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8604 variant<t_HEAD, t_TAIL...> >::value,
8607 const t_ARG_02& arg_02,
8608 const t_ARG_03& arg_03,
8609 const t_ARG_04& arg_04)
8613 Variant_Base::template baseEmplace<index>(arg_01, arg_02, arg_03, arg_04);
8615 return bsl::get<index>(*
this);
8618template <
class t_HEAD,
class... t_TAIL>
8619template <
class t_TYPE,
8625typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8627 variant<t_HEAD, t_TAIL...> >::value,
8630 const t_ARG_02& arg_02,
8631 const t_ARG_03& arg_03,
8632 const t_ARG_04& arg_04,
8633 const t_ARG_05& arg_05)
8637 Variant_Base::template baseEmplace<index>(
8638 arg_01, arg_02, arg_03, arg_04, arg_05);
8640 return bsl::get<index>(*
this);
8643template <
class t_HEAD,
class... t_TAIL>
8644template <
class t_TYPE,
8651typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8653 variant<t_HEAD, t_TAIL...> >::value,
8656 const t_ARG_02& arg_02,
8657 const t_ARG_03& arg_03,
8658 const t_ARG_04& arg_04,
8659 const t_ARG_05& arg_05,
8660 const t_ARG_06& arg_06)
8664 Variant_Base::template baseEmplace<index>(
8665 arg_01, arg_02, arg_03, arg_04, arg_05, arg_06);
8667 return bsl::get<index>(*
this);
8670template <
class t_HEAD,
class... t_TAIL>
8671template <
class t_TYPE,
8679typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8681 variant<t_HEAD, t_TAIL...> >::value,
8684 const t_ARG_02& arg_02,
8685 const t_ARG_03& arg_03,
8686 const t_ARG_04& arg_04,
8687 const t_ARG_05& arg_05,
8688 const t_ARG_06& arg_06,
8689 const t_ARG_07& arg_07)
8693 Variant_Base::template baseEmplace<index>(
8694 arg_01, arg_02, arg_03, arg_04, arg_05, arg_06, arg_07);
8696 return bsl::get<index>(*
this);
8699template <
class t_HEAD,
class... t_TAIL>
8700template <
class t_TYPE,
8709typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8711 variant<t_HEAD, t_TAIL...> >::value,
8714 const t_ARG_02& arg_02,
8715 const t_ARG_03& arg_03,
8716 const t_ARG_04& arg_04,
8717 const t_ARG_05& arg_05,
8718 const t_ARG_06& arg_06,
8719 const t_ARG_07& arg_07,
8720 const t_ARG_08& arg_08)
8724 Variant_Base::template baseEmplace<index>(
8725 arg_01, arg_02, arg_03, arg_04, arg_05, arg_06, arg_07, arg_08);
8727 return bsl::get<index>(*
this);
8730template <
class t_HEAD,
class... t_TAIL>
8731template <
class t_TYPE,
8741typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8743 variant<t_HEAD, t_TAIL...> >::value,
8746 const t_ARG_02& arg_02,
8747 const t_ARG_03& arg_03,
8748 const t_ARG_04& arg_04,
8749 const t_ARG_05& arg_05,
8750 const t_ARG_06& arg_06,
8751 const t_ARG_07& arg_07,
8752 const t_ARG_08& arg_08,
8753 const t_ARG_09& arg_09)
8757 Variant_Base::template baseEmplace<index>(arg_01,
8767 return bsl::get<index>(*
this);
8770template <
class t_HEAD,
class... t_TAIL>
8771template <
class t_TYPE,
8782typename bsl::enable_if<BloombergLP::bslstl::Variant_HasUniqueType<
8784 variant<t_HEAD, t_TAIL...> >::value,
8787 const t_ARG_02& arg_02,
8788 const t_ARG_03& arg_03,
8789 const t_ARG_04& arg_04,
8790 const t_ARG_05& arg_05,
8791 const t_ARG_06& arg_06,
8792 const t_ARG_07& arg_07,
8793 const t_ARG_08& arg_08,
8794 const t_ARG_09& arg_09,
8795 const t_ARG_10& arg_10)
8799 Variant_Base::template baseEmplace<index>(arg_01,
8810 return bsl::get<index>(*
this);
8813template <
class t_HEAD,
class... t_TAIL>
8814template <
size_t t_INDEX>
8818 Variant_Base::template baseEmplace<t_INDEX>();
8820 return bsl::get<t_INDEX>(*
this);
8823template <
class t_HEAD,
class... t_TAIL>
8824template <
size_t t_INDEX,
class t_ARG_01>
8828 Variant_Base::template baseEmplace<t_INDEX>(arg_01);
8830 return bsl::get<t_INDEX>(*
this);
8833template <
class t_HEAD,
class... t_TAIL>
8834template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02>
8837 const t_ARG_02& arg_02)
8839 Variant_Base::template baseEmplace<t_INDEX>(arg_01, arg_02);
8841 return bsl::get<t_INDEX>(*
this);
8844template <
class t_HEAD,
class... t_TAIL>
8845template <
size_t t_INDEX,
class t_ARG_01,
class t_ARG_02,
class t_ARG_03>
8848 const t_ARG_02& arg_02,
8849 const t_ARG_03& arg_03)
8851 Variant_Base::template baseEmplace<t_INDEX>(arg_01, arg_02, arg_03);
8853 return bsl::get<t_INDEX>(*
this);
8856template <
class t_HEAD,
class... t_TAIL>
8857template <
size_t t_INDEX,
8864 const t_ARG_02& arg_02,
8865 const t_ARG_03& arg_03,
8866 const t_ARG_04& arg_04)
8868 Variant_Base::template baseEmplace<t_INDEX>(
8869 arg_01, arg_02, arg_03, arg_04);
8871 return bsl::get<t_INDEX>(*
this);
8874template <
class t_HEAD,
class... t_TAIL>
8875template <
size_t t_INDEX,
8883 const t_ARG_02& arg_02,
8884 const t_ARG_03& arg_03,
8885 const t_ARG_04& arg_04,
8886 const t_ARG_05& arg_05)
8888 Variant_Base::template baseEmplace<t_INDEX>(
8889 arg_01, arg_02, arg_03, arg_04, arg_05);
8891 return bsl::get<t_INDEX>(*
this);
8894template <
class t_HEAD,
class... t_TAIL>
8895template <
size_t t_INDEX,
8904 const t_ARG_02& arg_02,
8905 const t_ARG_03& arg_03,
8906 const t_ARG_04& arg_04,
8907 const t_ARG_05& arg_05,
8908 const t_ARG_06& arg_06)
8910 Variant_Base::template baseEmplace<t_INDEX>(
8911 arg_01, arg_02, arg_03, arg_04, arg_05, arg_06);
8913 return bsl::get<t_INDEX>(*
this);
8916template <
class t_HEAD,
class... t_TAIL>
8917template <
size_t t_INDEX,
8927 const t_ARG_02& arg_02,
8928 const t_ARG_03& arg_03,
8929 const t_ARG_04& arg_04,
8930 const t_ARG_05& arg_05,
8931 const t_ARG_06& arg_06,
8932 const t_ARG_07& arg_07)
8934 Variant_Base::template baseEmplace<t_INDEX>(
8935 arg_01, arg_02, arg_03, arg_04, arg_05, arg_06, arg_07);
8937 return bsl::get<t_INDEX>(*
this);
8940template <
class t_HEAD,
class... t_TAIL>
8941template <
size_t t_INDEX,
8952 const t_ARG_02& arg_02,
8953 const t_ARG_03& arg_03,
8954 const t_ARG_04& arg_04,
8955 const t_ARG_05& arg_05,
8956 const t_ARG_06& arg_06,
8957 const t_ARG_07& arg_07,
8958 const t_ARG_08& arg_08)
8960 Variant_Base::template baseEmplace<t_INDEX>(
8961 arg_01, arg_02, arg_03, arg_04, arg_05, arg_06, arg_07, arg_08);
8963 return bsl::get<t_INDEX>(*
this);
8966template <
class t_HEAD,
class... t_TAIL>
8967template <
size_t t_INDEX,
8979 const t_ARG_02& arg_02,
8980 const t_ARG_03& arg_03,
8981 const t_ARG_04& arg_04,
8982 const t_ARG_05& arg_05,
8983 const t_ARG_06& arg_06,
8984 const t_ARG_07& arg_07,
8985 const t_ARG_08& arg_08,
8986 const t_ARG_09& arg_09)
8988 Variant_Base::template baseEmplace<t_INDEX>(arg_01,
8998 return bsl::get<t_INDEX>(*
this);
9001template <
class t_HEAD,
class... t_TAIL>
9002template <
size_t t_INDEX,
9015 const t_ARG_02& arg_02,
9016 const t_ARG_03& arg_03,
9017 const t_ARG_04& arg_04,
9018 const t_ARG_05& arg_05,
9019 const t_ARG_06& arg_06,
9020 const t_ARG_07& arg_07,
9021 const t_ARG_08& arg_08,
9022 const t_ARG_09& arg_09,
9023 const t_ARG_10& arg_10)
9025 Variant_Base::template baseEmplace<t_INDEX>(arg_01,
9036 return bsl::get<t_INDEX>(*
this);
9039template <
class t_HEAD,
class... t_TAIL>
9044 Variant_Base::operator=(
static_cast<const Variant_Base&
>(rhs));
9048template <
class t_HEAD,
class... t_TAIL>
9051 BloombergLP::bslmf::MovableRef<variant> rhs)
9053 variant<t_HEAD, t_TAIL...>& lvalue = rhs;
9054 Variant_Base::operator=(
9055 MoveUtil::move(
static_cast<Variant_Base&
>(lvalue)));
9058template <
class t_HEAD,
class... t_TAIL>
9059template <
class t_TYPE>
9062 BloombergLP::bslstl::Variant_AssignsFromType<
variant<t_HEAD, t_TAIL...>,
9064 variant<t_HEAD, t_TAIL...>&>::type
9069 if (index() == altIndex) {
9070 bsl::get<altIndex>(*
this) = rhs;
9075 emplace<altIndex>(rhs);
9083#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
9084template <
class t_HEAD,
class... t_TAIL>
9088 if (!valueless_by_exception()) {
9089 if (index() == other.
index()) {
9090 BloombergLP::bslstl::Variant_SwapVisitor<variant> swapper(
this);
9094 variant tmpThis(MoveUtil::move(*
this));
9097 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
9098 moveConstructor(
this);
9101#ifndef BSL_VARIANT_FULL_IMPLEMENTATION
9105 this->d_type = other.
index();
9108 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
9111#ifndef BSL_VARIANT_FULL_IMPLEMENTATION
9112 other.d_type = tmpThis.
index();
9118 BloombergLP::bslstl::Variant_MoveConstructVisitor<Variant_Base>
9119 moveConstructor(
this);
9121#ifndef BSL_VARIANT_FULL_IMPLEMENTATION
9122 this->d_type = other.
index();
9130template <
class t_HEAD,
class... t_TAIL>
9134 return this->d_type;
9137template <
class t_HEAD,
class... t_TAIL>
9148#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
9149template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
9155 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9156 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9159 return ImpUtil::get<Ret, t_INDEX>(obj);
9162template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
9163const typename variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...> >::type&
9164get(
const variant<t_HEAD, t_TAIL...>& obj)
9166 BSLMF_ASSERT((t_INDEX < variant_size<variant<t_HEAD, t_TAIL...> >::value));
9168 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9169 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9172 return ImpUtil::get<const Ret, t_INDEX>(obj);
9175template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
9176typename variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...> >::type&&
get(
9177 variant<t_HEAD, t_TAIL...>&& obj)
9179 BSLMF_ASSERT((t_INDEX < variant_size<variant<t_HEAD, t_TAIL...> >::value));
9181 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9182 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9185 return std::move(ImpUtil::get<Ret, t_INDEX>(obj));
9188template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
9189const typename variant_alternative<t_INDEX,
9190 variant<t_HEAD, t_TAIL...> >::type&&
9191get(
const variant<t_HEAD, t_TAIL...>&& obj)
9193 BSLMF_ASSERT((t_INDEX < variant_size<variant<t_HEAD, t_TAIL...> >::value));
9195 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9196 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9199 return std::move(ImpUtil::get<const Ret, t_INDEX>(obj));
9202#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
9203template <
size_t t_INDEX,
class t_VARIANT>
9204typename Variant_GetIndexReturnType<t_INDEX, t_VARIANT>::type
9209 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9212 return ImpUtil::get<Ret, t_INDEX>(obj);
9215template <
size_t t_INDEX,
class t_VARIANT>
9216typename Variant_GetIndexReturnType<
9218 BloombergLP::bslmf::MovableRef<t_VARIANT> >::type
9219get(BloombergLP::bslmf::MovableRef<t_VARIANT> obj)
9221 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
9222 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9225 t_VARIANT& lvalue = obj;
9227 return MoveUtil::move(ImpUtil::get<Ret, t_INDEX>(lvalue));
9232#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
9233template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
9234t_TYPE&
get(variant<t_HEAD, t_TAIL...>& obj)
9236 BSLMF_ASSERT((BloombergLP::bslstl::Variant_HasUniqueType<
9238 variant<t_HEAD, t_TAIL...> >::value));
9240 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9241 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9243 return ImpUtil::get<t_TYPE, BSLSTL_VARIANT_INDEX_OF(t_TYPE, Variant)>(obj);
9246template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
9247const t_TYPE&
get(
const variant<t_HEAD, t_TAIL...>& obj)
9249 BSLMF_ASSERT((BloombergLP::bslstl::Variant_HasUniqueType<
9251 variant<t_HEAD, t_TAIL...> >::value));
9253 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9254 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9256 return ImpUtil::get<
const t_TYPE,
9260template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
9261t_TYPE&&
get(variant<t_HEAD, t_TAIL...>&& obj)
9264 BloombergLP::bslstl::
9265 Variant_HasUniqueType<t_TYPE, variant<t_HEAD, t_TAIL...> >::value,
9266 "Type is not unique in variant");
9268 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9269 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9275template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
9276const t_TYPE&&
get(
const variant<t_HEAD, t_TAIL...>&& obj)
9279 BloombergLP::bslstl::
9280 Variant_HasUniqueType<t_TYPE, variant<t_HEAD, t_TAIL...> >::value,
9281 "Type is not unique in variant");
9283 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9284 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9291#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
9292template <
class t_TYPE,
class t_VARIANT>
9293typename Variant_GetTypeReturnType<t_TYPE&, t_VARIANT>::type
9297 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, t_VARIANT>::value));
9299 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9301 return ImpUtil::get<t_TYPE, BSLSTL_VARIANT_INDEX_OF(t_TYPE, t_VARIANT)>(
9305template <
class t_TYPE,
class t_VARIANT>
9306typename Variant_GetTypeReturnType<const t_TYPE&, t_VARIANT>::type
9310 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, t_VARIANT>::value));
9312 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9314 return ImpUtil::get<
const t_TYPE,
9318template <
class t_TYPE,
class t_VARIANT>
9319typename Variant_GetTypeReturnType<BloombergLP::bslmf::MovableRef<t_TYPE>,
9321get(BloombergLP::bslmf::MovableRef<t_VARIANT> obj)
9324 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, t_VARIANT>::value));
9326 typedef BloombergLP::bslmf::MovableRefUtil MoveUtil;
9327 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9329 t_VARIANT& lvalue = obj;
9330 return MoveUtil::move(
9337#ifdef BSL_VARIANT_FULL_IMPLEMENTATION
9338template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
9339typename add_pointer<
9340 typename variant_alternative<t_INDEX,
9341 variant<t_HEAD, t_TAIL...> >::type>::type
9344 BSLMF_ASSERT((t_INDEX < variant_size<variant<t_HEAD, t_TAIL...> >::value));
9346 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9347 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9350 if (ptr == 0 || ptr->index() != t_INDEX) {
9357template <
size_t t_INDEX,
class t_HEAD,
class... t_TAIL>
9358typename add_pointer<
const typename variant_alternative<
9360 variant<t_HEAD, t_TAIL...> >::type>::type
9363 BSLMF_ASSERT((t_INDEX < variant_size<variant<t_HEAD, t_TAIL...> >::value));
9365 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9366 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9369 if (ptr == 0 || ptr->index() != t_INDEX) {
9375template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
9379 BSLMF_ASSERT((BloombergLP::bslstl::Variant_HasUniqueType<
9381 variant<t_HEAD, t_TAIL...> >::value));
9383 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9384 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9393template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
9397 BSLMF_ASSERT((BloombergLP::bslstl::Variant_HasUniqueType<
9399 variant<t_HEAD, t_TAIL...> >::value));
9401 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9402 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9412#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
9413template <
size_t t_INDEX,
class t_VARIANT>
9414typename Variant_GetIndexReturnType<t_INDEX, t_VARIANT>::pointer
9419 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9422 if (ptr == 0 || ptr->index() != t_INDEX) {
9429template <
class t_TYPE,
class t_VARIANT>
9430typename Variant_GetTypeReturnType<t_TYPE, t_VARIANT>::pointer
9434 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, t_VARIANT>::value));
9436 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9447template <
class t_TYPE,
class t_VARIANT>
9448typename Variant_GetTypeReturnType<const t_TYPE, t_VARIANT>::pointer
9452 BloombergLP::bslstl::Variant_HasUniqueType<t_TYPE, t_VARIANT>::value));
9454 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9467#if !BSLS_COMPILERFEATURES_SIMULATE_CPP11_FEATURES
9469template <
class t_HASHALG,
class t_HEAD,
class... t_TAIL>
9474 BloombergLP::bslstl::Variant_HashVisitor<t_HASHALG> hashVisitor(
9476 visit(hashVisitor, input);
9483template <
class t_TYPE,
class t_HEAD,
class... t_TAIL>
9487 BSLMF_ASSERT((BloombergLP::bslstl::Variant_HasUniqueType<
9490 typedef typename bsl::variant<t_HEAD, t_TAIL...> Variant;
9494template <
class t_HEAD,
class... t_TAIL>
9498 BloombergLP::bslstl::variant_swapImpl(
9501 BloombergLP::bslstl::
9502 Variant_UsesBslmaAllocatorAny<t_HEAD, t_TAIL...>::value>(),
9508template <
class t_HEAD,
class... t_TAIL>
9512 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9520 return ImpUtil::Equal(lhs, rhs);
9523template <
class t_HEAD,
class... t_TAIL>
9527 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9535 return ImpUtil::NotEqual(lhs, rhs);
9538template <
class t_HEAD,
class... t_TAIL>
9542 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9553 return ImpUtil::LessThan(lhs, rhs);
9556template <
class t_HEAD,
class... t_TAIL>
9560 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9571 return ImpUtil::GreaterThan(lhs, rhs);
9574template <
class t_HEAD,
class... t_TAIL>
9578 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9589 return ImpUtil::LessOrEqual(lhs, rhs);
9592template <
class t_HEAD,
class... t_TAIL>
9596 typedef BloombergLP::bslstl::Variant_ImpUtil ImpUtil;
9608 return ImpUtil::GreaterOrEqual(lhs, rhs);
9611#if defined BSLS_COMPILERFEATURES_SUPPORT_THREE_WAY_COMPARISON && \
9612 defined BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS
9614template <
class... t_ALTS>
9615 requires(std::three_way_comparable<t_ALTS> && ...)
9616constexpr
std::common_comparison_category_t<
9617 std::compare_three_way_result_t<t_ALTS>...>
9618operator<=>(const variant<t_ALTS...>& lhs, const variant<t_ALTS...>& rhs)
9620 using RET = std::common_comparison_category_t<
9621 std::compare_three_way_result_t<t_ALTS>...>;
9623 const size_t lhs_index = lhs.index();
9624 const size_t rhs_index = rhs.index();
9626 if (lhs_index == rhs_index) {
9627 return BloombergLP::bslstl::Variant_ImpUtil::visitId<RET>(
9630 return bsl::get<t_INDEX>(lhs) <=> rhs_value;
9635 return lhs_index <=> rhs_index;
9641 return std::strong_ordering::equal;
9643 return std::strong_ordering::less;
9646 return std::strong_ordering::greater;
9656#undef BSL_VARIANT_FULL_IMPLEMENTATION
9657#undef BSLSTL_VARIANT_NOT_A_TYPE
9658#undef BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM
9659#undef BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM
9660#undef BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE
9661#undef BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE
9662#undef BSLSTL_VARIANT_HAS_UNIQUE_TYPE
9663#undef BSLSTL_VARIANT_TYPE_AT_INDEX
9664#undef BSLSTL_VARIANT_INDEX_OF
9665#undef BSLSTL_VARIANT_CONVERT_INDEX_OF
9666#undef BSLSTL_VARIANT_CONVERT_TYPE_OF
9667#undef BSLSTL_VARIANT_VISITID
9668#undef BSLSTL_VARIANT_RELOP_VISITOR_DEFINITON
#define BSLSTL_VARIANT_DEFINE_IF_HAS_UNIQUE_TYPE(TYPE)
Definition bslstl_variant.h:890
#define BSLSTL_VARIANT_DEFINE_IF_CONSTRUCTS_FROM(VARIANT, TYPE)
Definition bslstl_variant.h:857
#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM_STD(STD_VARIANT)
Definition bslstl_variant.h:880
#define BSLSTL_VARIANT_HAS_UNIQUE_TYPE(TYPE)
Definition bslstl_variant.h:906
#define BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM(VARIANT, TYPE)
Definition bslstl_variant.h:866
#define BSLSTL_VARIANT_INDEX_OF(TYPE, VARIANT)
Definition bslstl_variant.h:920
#define BSLSTL_VARIANT_TYPE_AT_INDEX(INDEX)
Definition bslstl_variant.h:913
#define BSLSTL_VARIANT_RELOP_VISITOR_DEFINITON(NAME, OP)
Definition bslstl_variant.h:2754
#define BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(TYPE)
Definition bslstl_variant.h:898
#define BSLSTL_VARIANT_VISITID(RET, VISITOR, VAROBJ)
Definition bslstl_variant.h:943
#define BSLSTL_VARIANT_CONVERT_INDEX_OF(TYPE, VARIANT)
Definition bslstl_variant.h:927
Definition bslma_bslallocator.h:580
BloombergLP::bslma::Allocator * mechanism() const
Definition bslma_bslallocator.h:1126
Definition bslstl_variant.h:3685
size_t index() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_variant.h:9132
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
void swap(variant &other)
Definition bslstl_variant.h:9086
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, const t_ARG_08 &arg_08, const t_ARG_09 &arg_09, const t_ARG_10 &arg_10, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, const t_ARG_08 &arg_08, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
BSLMF_NESTED_TRAIT_DECLARATION_IF(variant, BloombergLP::bslma::UsesBslmaAllocator,(BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny< t_HEAD, t_TAIL... >::value))
bool valueless_by_exception() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_variant.h:9139
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
BSLMF_NESTED_TRAIT_DECLARATION_IF(variant, BloombergLP::bslmf::UsesAllocatorArgT,(BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny< t_HEAD, t_TAIL... >::value))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
BSLMF_NESTED_TRAIT_DECLARATION_IF(variant, BloombergLP::bslmf::IsBitwiseMoveable,(BloombergLP::bslstl::Variant_IsBitwiseMoveableAll< t_HEAD, t_TAIL... >::value))
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, const t_ARG_08 &arg_08, const t_ARG_09 &arg_09, const t_ARG_10 &arg_10, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, const t_TYPE &value, BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM(variant, t_TYPE))
variant(const t_TYPE &value, BSLSTL_VARIANT_DECLARE_IF_CONSTRUCTS_FROM(variant, t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
Variant_Base::allocator_type allocator_type
Type alias to the allocator type used by variant.
Definition bslstl_variant.h:3725
allocator_type get_allocator() const BSLS_KEYWORD_NOEXCEPT
Definition bslstl_variant.h:5531
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant()
Definition bslstl_variant.h:7320
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, const t_ARG_08 &arg_08, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
friend struct BloombergLP::bslstl::Variant_ImpUtil
Definition bslstl_variant.h:3694
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant & operator=(const variant &rhs)
Definition bslstl_variant.h:9041
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, const t_ARG_08 &arg_08, const t_ARG_09 &arg_09, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
bsl::enable_if< BloombergLP::bslstl::Variant_HasUniqueType< t_TYPE, variant >::value, t_TYPE & >::type emplace()
Definition bslstl_variant.h:8539
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, const t_ARG_02 &arg_02, const t_ARG_03 &arg_03, const t_ARG_04 &arg_04, const t_ARG_05 &arg_05, const t_ARG_06 &arg_06, const t_ARG_07 &arg_07, const t_ARG_08 &arg_08, const t_ARG_09 &arg_09, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::in_place_type_t< t_TYPE >, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::allocator_arg_t, allocator_type allocator, bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
variant(bsl::in_place_type_t< t_TYPE >, const t_ARG_01 &arg_01, BSLSTL_VARIANT_DECLARE_IF_HAS_UNIQUE_TYPE(t_TYPE))
Definition bslmf_movableref.h:751
Definition bslstl_variant.h:2598
void operator()(bsl::in_place_index_t< t_INDEX >, const t_TYPE &value) const
Definition bslstl_variant.h:2626
Variant_CopyAssignVisitor(t_VARIANT *variant)
Definition bslstl_variant.h:2609
t_TYPE & value()
Definition bslstl_variant.h:5848
Variant_DataImp()=default
Definition bslstl_variant.h:2869
void operator()(t_TYPE &value) const
Definition bslstl_variant.h:2890
Variant_HashVisitor(t_HASHALG &hashAlg)
Definition bslstl_variant.h:2880
Definition bslstl_variant.h:2654
void operator()(bsl::in_place_index_t< t_INDEX >, t_TYPE &value) const
Definition bslstl_variant.h:2684
Variant_MoveAssignVisitor(t_VARIANT *variant)
Definition bslstl_variant.h:2668
Definition bslstl_variant.h:2556
void operator()(bsl::in_place_index_t< t_INDEX >, t_TYPE &other) const
Definition bslstl_variant.h:2583
Variant_MoveConstructVisitor(t_VARIANT_BASE *variant)
Definition bslstl_variant.h:2570
Definition bslstl_variant.h:2814
Variant_SwapVisitor(t_VARIANT *variant)
Definition bslstl_variant.h:2826
void operator()(bsl::in_place_index_t< t_INDEX >, t_TYPE &value) const
Definition bslstl_variant.h:2841
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT_SAFE(X)
Definition bsls_assert.h:1762
#define BSLS_THROW(X)
Definition bsls_exceptionutil.h:374
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_KEYWORD_CONSTEXPR_CPP14
Definition bsls_keyword.h:595
#define BSLS_KEYWORD_CONSTEXPR
Definition bsls_keyword.h:588
#define BSLS_KEYWORD_INLINE_CONSTEXPR
Definition bsls_keyword.h:617
#define BSLS_KEYWORD_NOEXCEPT
Definition bsls_keyword.h:632
#define BSLS_KEYWORD_INLINE_VARIABLE
Definition bsls_keyword.h:623
#define BSLS_UTIL_ADDRESSOF(OBJ)
Definition bsls_util.h:289
void BSLSTL_VARIANT_NOT_A_TYPE
Definition bslstl_variant.h:322
Definition bdlb_printmethods.h:283
bool holds_alternative(const variant< t_HEAD, t_TAIL... > &obj) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_variant.h:9484
void hashAppend(HASH_ALGORITHM &hashAlgorithm, const array< TYPE, SIZE > &input)
Pass the specified input to the specified hashAlgorithm
Definition bslstl_array.h:950
Variant_GetIndexReturnType< t_INDEX, t_VARIANT >::pointer get_if(t_VARIANT *obj) BSLS_KEYWORD_NOEXCEPT
Definition bslstl_variant.h:9415
BSLS_KEYWORD_CONSTEXPR_CPP14 TYPE & get(array< TYPE, SIZE > &a) BSLS_KEYWORD_NOEXCEPT
BSLS_KEYWORD_INLINE_CONSTEXPR size_t variant_npos
Definition bslstl_variant.h:373
bsl::invoke_result< t_VISITOR &, typenamebsl::variant_alternative< 0, t_VARIANT >::type & >::type visit(t_VISITOR &visitor, t_VARIANT &variant)
Definition bslstl_variant.h:2262
Definition bslstl_algorithm.h:82
void variant_swapImpl(bsl::true_type, t_VARIANT &lhs, t_VARIANT &rhs)
Definition bslstl_variant.h:5884
Definition bdldfp_decimal.h:5188
BloombergLP::bslmf::MovableRef< typename bsl::variant_alternative< t_INDEX, t_VARIANT >::type > type
Definition bslstl_variant.h:582
bsl::variant_alternative< t_INDEX, constt_VARIANT >::type * pointer
Definition bslstl_variant.h:571
bsl::variant_alternative< t_INDEX, constt_VARIANT >::type & type
Definition bslstl_variant.h:568
bsl::variant_alternative< t_INDEX, t_VARIANT >::type & type
Definition bslstl_variant.h:556
bsl::variant_alternative< t_INDEX, t_VARIANT >::type * pointer
Definition bslstl_variant.h:559
Definition bslstl_variant.h:544
Definition bslstl_variant.h:589
t_HEAD type
Definition bslstl_variant.h:425
Definition bslstl_variant.h:412
Definition bslmf_addpointer.h:169
BloombergLP::bslmf::AddPointer_Impl< t_TYPE >::type type
Definition bslmf_addpointer.h:175
Definition bslmf_conditional.h:120
Definition bslmf_enableif.h:525
Definition bslstl_inplace.h:175
Definition bslstl_inplace.h:137
Definition bslmf_integralconstant.h:244
Definition bslmf_removecv.h:118
remove_const< typenameremove_volatile< t_TYPE >::type >::type type
Definition bslmf_removecv.h:126
variant_alternative< t_INDEX, t_TYPE >::type const type
Definition bslstl_variant.h:388
variant_alternative< t_INDEX, t_TYPE >::type const volatile type
Definition bslstl_variant.h:399
BSLMF_ASSERT((t_INDEX< bsl::variant_size< variant< t_HEAD, t_TAIL... > >::value))
variant_alternative< t_INDEX, t_TYPE >::type volatile type
Definition bslstl_variant.h:393
Definition bslstl_variant.h:384
Definition bslstl_variant.h:341
BloombergLP::bslmf::MovableRefUtil MoveUtil
Definition bslstl_variant.h:2924
BloombergLP::bslma::Allocator * mechanism() const
Return the mechanism of the stored allocator.
Definition bslstl_variant.h:2953
bsl::allocator< char > allocator_type
Definition bslstl_variant.h:2925
Variant_AllocatorBase()
Definition bslstl_variant.h:2934
allocator_type d_allocator
Definition bslstl_variant.h:2928
Variant_AllocatorBase(allocator_type allocator)
Definition bslstl_variant.h:2945
Variant_AllocatorBase(const Variant_AllocatorBase &original)
Definition bslstl_variant.h:2938
Definition bslstl_variant.h:2901
BloombergLP::bslma::Allocator * mechanism() const
Definition bslstl_variant.h:2913
Definition bslstl_variant.h:2988
Definition bslstl_variant.h:2974
BSLMF_NESTED_TRAIT_DECLARATION_IF(Variant_Base, BloombergLP::bslma::UsesBslmaAllocator,(BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny< t_HEAD, t_TAIL... >::value))
Variant_Base()
Definition bslstl_variant.h:6042
bsl::conditional< BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny< t_HEAD, t_TAIL... >::value, bsl::allocator< char >, NoAlloc >::type allocator_type
Type alias to the allocator type used by variant.
Definition bslstl_variant.h:2996
size_t d_type
Definition bslstl_variant.h:3002
void baseEmplace()
Definition bslstl_variant.h:6882
bsl::variant< t_HEAD, t_TAIL... > Variant
Definition bslstl_variant.h:2984
BSLMF_NESTED_TRAIT_DECLARATION_IF(Variant_Base, BloombergLP::bslmf::IsBitwiseMoveable,(BloombergLP::bslstl::Variant_IsBitwiseMoveableAll< t_HEAD, t_TAIL... >::value))
Variant_Union d_union
Union holding the alternative object.
Definition bslstl_variant.h:3005
BSLMF_NESTED_TRAIT_DECLARATION_IF(Variant_Base, BloombergLP::bslmf::UsesAllocatorArgT,(BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny< t_HEAD, t_TAIL... >::value))
~Variant_Base()
Destroy this object. The contained value, if any, is destroyed.
Definition bslstl_variant.h:6846
BloombergLP::bslmf::MovableRefUtil MoveUtil
Definition bslstl_variant.h:2977
void reset() BSLS_KEYWORD_NOEXCEPT
Destroy the contained value, if any.
Definition bslstl_variant.h:7267
BloombergLP::bslstl::Variant_Union< t_HEAD, t_TAIL... > Variant_Union
Definition bslstl_variant.h:2983
Variant_Base & operator=(const Variant_Base &rhs)
Definition bslstl_variant.h:7210
BloombergLP::bslstl::Variant_AllocatorBase< BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny< t_HEAD, t_TAIL... >::value > AllocBase
Definition bslstl_variant.h:2981
Definition bslstl_variant.h:762
Definition bslstl_variant.h:2701
void operator()(t_TYPE &object) const
Definition bslstl_variant.h:2709
BSLS_KEYWORD_CONSTEXPR Variant_NoSuchType(int) BSLS_KEYWORD_NOEXCEPT
Create a Variant_NoSuchType object.
Definition bslstl_variant.h:5809
Definition bslstl_variant.h:782
Definition bslstl_variant.h:2022