BloombergLP::bslalg::ContainerBase_EmptyBase

One of two possible base classes for ContainerBase. This class is for stateless allocators (i.e., that have size 0), including std::allocator (but not bsl::allocator). Provides access to the allocator.

Synopsis

Declared in <bslalg_containerbase.h>

template<class ALLOCATOR>
class ContainerBase_EmptyBase;

Description

This class does not have a subobject of type ALLOCATOR. Instead, a (zero-sized) ALLOCATOR is implicitly sited at the address of the start of an object of this class. This approach was chosen in preference to inheriting from ALLOCATOR so as to avoid inheriting the interface for ALLOCATOR and thus making this class (and all classes derived from it) improperly categorized as an allocator when using the bslma::IsStdAllocator metafunction. ContainerBase_EmptyBase is an empty class and will not increase the footprint of a derived class.

Type Aliases

NameDescription
AllocatorType Alias for the (template parameter) ALLOCATOR type.

Member Functions

NameDescription
ContainerBase_EmptyBase [constructor]Construct this object to hold a copy of the specified basicAllocator of the parameterized ALLOCATOR type.
~ContainerBase_EmptyBase [destructor]Destroy this object.
allocatorRef allocatorRef overloads