BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslalg::ContainerBase_EmptyBase< ALLOCATOR > Class Template Reference

#include <bslalg_containerbase.h>

Public Types

typedef ALLOCATOR AllocatorType
 

Public Member Functions

 ContainerBase_EmptyBase (const ALLOCATOR &basicAllocator)
 
 ~ContainerBase_EmptyBase ()
 Destroy this object.
 
ALLOCATOR & allocatorRef ()
 
const ALLOCATOR & allocatorRef () const
 

Detailed Description

template<class ALLOCATOR>
class bslalg::ContainerBase_EmptyBase< ALLOCATOR >

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.

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.

See bslalg_containerbase

Member Typedef Documentation

◆ AllocatorType

template<class ALLOCATOR >
typedef ALLOCATOR bslalg::ContainerBase_EmptyBase< ALLOCATOR >::AllocatorType

Constructor & Destructor Documentation

◆ ContainerBase_EmptyBase()

template<class ALLOCATOR >
bslalg::ContainerBase_EmptyBase< ALLOCATOR >::ContainerBase_EmptyBase ( const ALLOCATOR &  basicAllocator)
inlineexplicit

Construct this object to hold a copy of the specified basicAllocator of the parameterized ALLOCATOR type.

◆ ~ContainerBase_EmptyBase()

template<class ALLOCATOR >
bslalg::ContainerBase_EmptyBase< ALLOCATOR >::~ContainerBase_EmptyBase ( )
inline

Member Function Documentation

◆ allocatorRef() [1/2]

template<class ALLOCATOR >
ALLOCATOR & bslalg::ContainerBase_EmptyBase< ALLOCATOR >::allocatorRef ( )
inline

Return a reference to the modifiable allocator used to construct this object.

◆ allocatorRef() [2/2]

template<class ALLOCATOR >
const ALLOCATOR & bslalg::ContainerBase_EmptyBase< ALLOCATOR >::allocatorRef ( ) const
inline

Return a reference to the non-modifiable allocator used to construct this object.


The documentation for this class was generated from the following file: