BloombergLP::bslstl::Variant_AllocatorBase

This component-private struct keeps track of the allocator for a bsl::variant object. The primary template is used when the variant is not allocator-aware (because it has no allocator-aware alternatives).

Synopsis

Declared in <bslstl_variant.h>

template<bool t_AA>
struct Variant_AllocatorBase;

Member Functions

NameDescription
mechanism Return a null pointer. Note that this method has the same return type as the allocator-aware version so that the remainder of the implementation of bsl::variant is abstracted with respect to whether or not the specialization is allocator-aware; this is why both methods return bslma::Allocator* instead of bsl::allocator<char>. The returned pointer will be ignored (and not dereferenced) when passed to bslma::ConstructionUtil::construct.

Specializations

NameDescription
Variant_AllocatorBase<true> This specialization is used when the variant is allocator-aware.

Derived Classes

NameDescription
Variant_Base 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.