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

Name

Description

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

Name

Description

Variant_AllocatorBase<true>

This specialization is used when the variant is allocator‐aware.

Derived Classes

Name

Description

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.

Created with MrDocs