Define the data representation and special member functions of bsl::variant.
Declared in <bslstl_variant.h>
template<
class t_HEAD,
class... t_TAIL>
struct Variant_Base
: BloombergLP::bslstl::Variant_AllocatorBase<BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny<t_HEAD, t_TAIL...>::value>
This component-private struct defines the data representation of bsl::variant and contains the implementations of its special member functions (which must be defaulted in bsl::variant itself).
This class also contains implementations of additional constructors and methods needed for the correct functionality of the variant class hierarchy.
| Name | Description |
|---|---|
BloombergLP::bslstl::Variant_AllocatorBase<BloombergLP::bslstl::Variant_UsesBslmaAllocatorAny<t_HEAD, t_TAIL...>::value> | This component-private struct keeps track of the allocator for a bsl::variant object. |
| Name | Description |
|---|---|
NoAlloc | This trivial tag type is used as a dummy when Variant_Base wraps a non-allocator-aware type. |
| Name | Description |
|---|---|
AllocBase | Base class providing allocator support when needed. |
MoveUtil | Utility for movable reference operations. |
Variant | Corresponding public bsl::variant type. |
Variant_Union | Union holding the active alternative objects. |
allocator_type | Type alias to the allocator type used by variant. |
| Name | Description |
|---|---|
d_type | Index of the currently active alternative in this variant object, or bsl::variant_npos if the variant is valueless by exception. |
d_union | Union holding the alternative object. |