[#BloombergLP-bslma] = xref:BloombergLP.adoc[BloombergLP]::bslma :relfileprefix: ../ :mrdocs: Package namespace for memory‐allocation mechanisms. == Types [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/AAModel.adoc[`AAModel`] | Metafunction that yields (is derived from) a model tag type that indicates the AA model preferred for the specified type ‐‐ one of `AAModelPmr`, `AAModelBsl`, `AAModelLegacy`, `AAModelStl`, or `AAModelNone`. If `TYPE` supports more than one of AA models, then the result is the first in the preceding list that is supported. | xref:BloombergLP/bslma/AAModelBsl.adoc[`AAModelBsl`] | Model tag for bsl‐AA types. | xref:BloombergLP/bslma/AAModelIsSupported-06.adoc[`AAModelIsSupported`] | Predicate metafunction that determines if the specified `TYPE` supports the specified `MODEL` AA model. It yields (i.e., is derived from) `bsl:true_type` if type `TYPE` supports AA model `MODEL`; otherwise it yields `false_type`. `MODEL` Must be one of `AAModelNone`, `AAModelLegacy`, `AAModelBsl`, `AAModelPmr`, or `AAModelStl`. This metafunction can yield `true_type` for more than one type `MODEL` type, e.g., it will yield `true_type` if `TYPE` is *bsl‐AA*, and `MODEL` is either `AAModelBsl` or `AAModelLegacy`, since `TYPE` can be constructed with either allocator type. | xref:BloombergLP/bslma/AAModelLegacy.adoc[`AAModelLegacy`] | Model tag for legacy‐AA types. | xref:BloombergLP/bslma/AAModelNone.adoc[`AAModelNone`] | Model tag for non‐AA types. | xref:BloombergLP/bslma/AAModelPmr.adoc[`AAModelPmr`] | Model tag for pmr‐AA types. | xref:BloombergLP/bslma/AAModelStl.adoc[`AAModelStl`] | Model tag for stl‐AA types. | xref:BloombergLP/bslma/AATypeUtil.adoc[`AATypeUtil`] | Namespace for utility functions on allocator‐aware types | xref:BloombergLP/bslma/Allocator.adoc[`Allocator`] | This protocol class provides a pure abstract interface and contract for clients and suppliers of raw memory. If the requested memory cannot be returned, the contract requires that an `std::bad_alloc` exception be thrown. Note that memory is guaranteed to be sufficiently aligned for any object of the requested size on the current platform, which may be less than the maximal alignment guarantee afforded by global `operator new`. | xref:BloombergLP/bslma/AllocatorTraits_CallMaxSize-07.adoc[`AllocatorTraits_CallMaxSize`] | Fallback `max_size` implementation when the allocator does not provide its own `max_size` member function. | xref:BloombergLP/bslma/AllocatorTraits_ConstPointerType-04.adoc[`AllocatorTraits_ConstPointerType`] | Metafunction that yields the const pointer type for the specified (template parameter) `T`. | xref:BloombergLP/bslma/AllocatorTraits_ConstVoidPointerType-09.adoc[`AllocatorTraits_ConstVoidPointerType`] | Metafunction that yields the const void pointer type for the specified (template parameter) `T`. If `T` defines a nested alias named `const_void_pointer`, then `type` is `T::const_void_pointer`; otherwise `type` is `const void *`. | xref:BloombergLP/bslma/AllocatorTraits_DifferenceType-0d.adoc[`AllocatorTraits_DifferenceType`] | Metafunction that yields the difference type for the specified (template parameter) `T`. If `T` defines a nested alias named `difference_type`, then `type` is `T::difference_type`; otherwise `type` is `std::ptrdiff_t`. | xref:BloombergLP/bslma/AllocatorTraits_HasConstructMethod.adoc[`AllocatorTraits_HasConstructMethod`] | This `struct` template provides a mechanism for determining whether a given (template parameter) `T` defines a `construct` method with the specified return type and argument types. | xref:BloombergLP/bslma/AllocatorTraits_HasDestroyMethod.adoc[`AllocatorTraits_HasDestroyMethod`] | Metafunction that detects whether `T` provides a `destroy` method with the specified signature. | xref:BloombergLP/bslma/AllocatorTraits_HasIsAlwaysEqual.adoc[`AllocatorTraits_HasIsAlwaysEqual`] | This `struct` template provides a mechanism for determining whether a given (template parameter) `ALLOCATOR_TYPE` defines a nested alias named`is_always_equal`. The static boolean member `value` (nested alias named `type`) is `true` (`bsl::true_type`) if `ALLOCATOR_TYPE` defines such an alias, and `false` (`bsl::false_type`) otherwise. | xref:BloombergLP/bslma/AllocatorTraits_HasPropOnCopyAssign.adoc[`AllocatorTraits_HasPropOnCopyAssign`] | This `struct` template provides a mechanism for determining whether a given (template parameter) `ALLOCATOR_TYPE` defines a nested alias named`propagate_on_container_copy_assignment`. The static boolean member `value` (nested alias named `type`) is `true` (`bsl::true_type`) if `ALLOCATOR_TYPE` defines such an alias, and `false` (`bsl::false_type`) otherwise. | xref:BloombergLP/bslma/AllocatorTraits_HasPropOnMoveAssign.adoc[`AllocatorTraits_HasPropOnMoveAssign`] | This `struct` template provides a mechanism for determining whether a given (template parameter) `ALLOCATOR_TYPE` defines a nested alias named`propagate_on_container_move_assignment`. The static boolean member `value` (nested alias named `type`) is `true` (`bsl::true_type`) if `ALLOCATOR_TYPE` defines such an alias, and `false` (`bsl::false_type`) otherwise. | xref:BloombergLP/bslma/AllocatorTraits_HasPropOnSwap.adoc[`AllocatorTraits_HasPropOnSwap`] | This `struct` template provides a mechanism for determining whether a given (template parameter) `ALLOCATOR_TYPE` defines a nested alias named`propagate_on_container_swap`. The static boolean member `value` (nested alias named `type`) is `true` (`bsl::true_type`) if `ALLOCATOR_TYPE` defines such an alias, and `false` (`bsl::false_type`) otherwise. | xref:BloombergLP/bslma/AllocatorTraits_HasSelectOnCopyMethod.adoc[`AllocatorTraits_HasSelectOnCopyMethod`] | This `struct` template provides a mechanism for determining whether a given (template parameter) `ALLOCATOR_TYPE` defines a `const` member function named `select_on_container_copy_construction` that takes no arguments and returns an `ALLOCATOR_TYPE` object by value. The static boolean `value` (nested `type` alias) is `true` (`bsl::true_type`) if `ALLOCATOR_TYPE` defines such a method, and `false` (`bsl::false_type`) otherwise. | xref:BloombergLP/bslma/AllocatorTraits_IsAlwaysEqual-0e.adoc[`AllocatorTraits_IsAlwaysEqual`] | This `struct` template sets the boolean type for the attribute named `is_always_equal` to the nested type alias in the given (template parameter) `ALLOC` if `ALLOC` defines such an alias (i.e., if `true == AllocatorTraits_HasIsAlwaysEqual<ALLOCATOR_TYPE>::value`). | xref:BloombergLP/bslma/AllocatorTraits_PointerType-0e.adoc[`AllocatorTraits_PointerType`] | Metafunction that yields the pointer type for the specified (template parameter) `T`. If `T` defines a nested alias named `pointer`, then `type` is `T::pointer`; otherwise `type` is `T::value_type *`. | xref:BloombergLP/bslma/AllocatorTraits_PropOnCopyAssign-0a.adoc[`AllocatorTraits_PropOnCopyAssign`] | This `struct` template sets the boolean type for the attribute named `propagate_on_container_copy_assignment` to `bsl::false_type` if the given (template parameter) `ALLOCATOR_TYPE` does not define such an alias (i.e., `false == AllocatorTraits_HasPropOnCopyAssign<ALLOCATOR_TYPE>::value`). | xref:BloombergLP/bslma/AllocatorTraits_PropOnMoveAssign-05.adoc[`AllocatorTraits_PropOnMoveAssign`] | This `struct` template sets the boolean type for the attribute named `propagate_on_container_move_assignment` to `bsl::false_type` if the given (template parameter) `ALLOCATOR_TYPE` does not define such an alias (i.e., `false == AllocatorTraits_HasPropOnMoveAssign<ALLOCATOR_TYPE>::value`). | xref:BloombergLP/bslma/AllocatorTraits_PropOnSwap-07.adoc[`AllocatorTraits_PropOnSwap`] | This `struct` template sets the boolean type for the attribute named `propagate_on_container_swap` to `bsl::false_type` if the given (template parameter) `ALLOCATOR_TYPE` does not define such an alias (i.e., `false == AllocatorTraits_HasPropOnSwap<ALLOCATOR_TYPE>::value`). | xref:BloombergLP/bslma/AllocatorTraits_RebindAlloc-0a.adoc[`AllocatorTraits_RebindAlloc`] | should be pointer_traits::rebind of template above | xref:BloombergLP/bslma/AllocatorTraits_RebindFront-0d.adoc[`AllocatorTraits_RebindFront`] | There shall be no member named `type` unless T is a class template with only type parameters. | xref:BloombergLP/bslma/AllocatorTraits_SizeType-0c.adoc[`AllocatorTraits_SizeType`] | Metafunction that yields the size type for the specified (template parameter) `T`. | xref:BloombergLP/bslma/AllocatorTraits_VoidPointerType-08c.adoc[`AllocatorTraits_VoidPointerType`] | Metafunction that yields the void pointer type for the specified (template parameter) `T`. | xref:BloombergLP/bslma/AllocatorUtil.adoc[`AllocatorUtil`] | Namespace for utility functions on allocators | xref:BloombergLP/bslma/AllocatorUtil_Traits-02.adoc[`AllocatorUtil_Traits`] | Extend the notion of `allocator_traits` to apply to both standard allocator and to pointer‐to‐memory‐resource types. If the (template parameter) `t_ALLOCATOR` is a non‐pointer type (i.e., an allocator class), then inherits from `bsl::allocator_traits<t_ALLOCATOR>::rebind_traits<t_TYPE>`. However, if `t_ALLOCATOR` is a pointer type, then inherits from `bsl::allocator_traits<bsl::allocator<t_TYPE>>` for pointers to classes derived from `bslma::Allocator` and from `bsl::allocator_traits<bsl::polymorphic_allocator<t_TYPE>>` for pointers to other classes derived from `bsl::memory_resource`. This primary template is for non‐pointer `t_ALLOCATOR` template arguments. | xref:BloombergLP/bslma/AutoDeallocator.adoc[`AutoDeallocator`] | This class implements a range proctor that, unless its `release` method has previously been invoked, automatically deallocates the contiguous sequence of managed memory blocks upon its own destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. Each of the managed memory blocks must have been supplied by this allocator (or pool), which must remain valid throughout the lifetime of the range proctor. Note that when the length of this object is non‐zero, it must refer to a non‐null array of memory blocks. | xref:BloombergLP/bslma/AutoDestructor.adoc[`AutoDestructor`] | This class implements a range proctor that, unless its `release` method has previously been invoked, automatically destroys the contiguous sequence of managed objects upon its own destruction by invoking each object's destructor. If `release` is invoked (see `release`), the proctor will not destroy any objects upon its own destruction (unless `reset` is invoked to assign the proctor another contiguous sequence of objects for management). Note that when the length of this object is non‐zero, it must refer to a non‐null array of objects. | xref:BloombergLP/bslma/AutoRawDeleter.adoc[`AutoRawDeleter`] | This class implements a range proctor that, unless its `release` method has previously been invoked, automatically deletes the contiguous sequence of managed objects upon destruction by iterating on each (managed) object, first invoking the object's destructor, and then free memory by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The sequence of managed objects of parameterized `TYPE` must have been created using memory provided by this allocator (or pool), which must remain valid throughout the lifetime of this range proctor. Note that when the length of this object is non‐zero, it must refer to a non‐null array of objects. | xref:BloombergLP/bslma/BslAllocator_Voidish.adoc[`BslAllocator_Voidish`] | Object type that will be placeholder for 'void' | xref:BloombergLP/bslma/BufferAllocator.adoc[`BufferAllocator`] | This `class` provides a concrete buffer allocator that implements the `Allocator` interface, and allocates memory blocks from a fixed‐size buffer that is supplied by the user at construction. The allocator can supply memory that can be maximally (default) or naturally aligned. | xref:BloombergLP/bslma/ConstructionUtil.adoc[`ConstructionUtil`] | This `struct` provides a namespace for utility functions that construct elements of (a template parameter) `TARGET_TYPE`. | xref:BloombergLP/bslma/ConstructionUtil_AllocAdaptorUtil-06.adoc[`ConstructionUtil_AllocAdaptorUtil`] | Component‐private utility for adapting allocator objects (see specializations). | xref:BloombergLP/bslma/ConstructionUtil_ConstructionTrait.adoc[`ConstructionUtil_ConstructionTrait`] | Metafunction yielding one of the following three `value` constants: | xref:BloombergLP/bslma/ConstructionUtil_IsAllocatorPtr-06.adoc[`ConstructionUtil_IsAllocatorPtr`] | Metafunction that inherits from `true_type` if the `ALLOC` type is a pointer to `bslma::Allocator` or a class derived from it and `false_type` otherwise. | xref:BloombergLP/bslma/DeallocateBytesProctor.adoc[`DeallocateBytesProctor`] | This class implements a proctor that, unless its `release` method has previously been invoked, automatically deallocates a managed block of memory upon destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed memory block must have been provided by the supplied allocator (or pool); the allocator (or pool) must remain valid throughout the lifetime of the proctor object. If `ALLOCATOR` is a non‐pointer type, it is assumed to be STL compatible; otherwise it is assumed have the same deallocation interface as `bslma::Allocator`. | xref:BloombergLP/bslma/DeallocateBytesProctor_PtrType-0e7.adoc[`DeallocateBytesProctor_PtrType`] | This metafunction has a nested `type` that indicates the correct `void` pointer type to use to manage bytes allocated from an allocator having the specified `ALLOCATOR` template parameter type. This primary template yields the `void_pointer` type specified by the `allocator_traits` for `ALLOCATOR`. | xref:BloombergLP/bslma/DeallocateObjectProctor.adoc[`DeallocateObjectProctor`] | This class implements a proctor that, unless its `release` method has previously been invoked, automatically deallocates a managed object upon destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed object of parameterized `TYPE` must be memory that was provided by this allocator (or pool); the allocator (or pool) must remain valid throughout the lifetime of the proctor object. If `ALLOCATOR` is a non‐pointer type, it is assumed to be STL compatible; otherwise, it is assumed have a `deallocate` method with a single 'void *' parameter, i.e., the same deallocation interface as `bslma::Allocator`. | xref:BloombergLP/bslma/DeallocateObjectProctor_PtrType-0d.adoc[`DeallocateObjectProctor_PtrType`] | This metafunction has a nested `type` that indicates the correct pointer type to use to manage an object of the specified `TYPE` template parameter allocated from an allocator having the specified `ALLOCATOR` template parameter type. This primary template yields the pointer type specified by `ALLOCATOR`, after rebinding to the specified `TYPE`. | xref:BloombergLP/bslma/DeallocatorGuard.adoc[`DeallocatorGuard`] | This class implements a guard that unconditionally deallocates a block of managed memory upon destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed memory must have been supplied by the allocator (or pool), which must remain valid throughout the lifetime of the guard object. | xref:BloombergLP/bslma/DeallocatorProctor.adoc[`DeallocatorProctor`] | This class implements a proctor that, unless its `release` method has previously been invoked, automatically deallocates a block of managed memory upon destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed memory must have been provided by this allocator (or pool), which must remain valid throughout the lifetime of the proctor object. | xref:BloombergLP/bslma/Default.adoc[`Default`] | This struct is a mechanism with global state, i.e., all state is held in global variables and all functions are class methods. The state consists of two distinct parts that don't influence one another: the default allocator and the global allocator. All addresses are stored without assuming ownership. | xref:BloombergLP/bslma/DefaultAllocatorGuard.adoc[`DefaultAllocatorGuard`] | Upon construction, an object of this class saves the current default allocator and installs the user‐specified allocator as the default allocator. On destruction, the original default allocator is restored. Objects of this class are intended for testing purposes _only_ and are _not_ guaranteed to be safe in production environments. | xref:BloombergLP/bslma/Default_NewDeleteSetter.adoc[`Default_NewDeleteSetter`] | Stateless class to set the initial default resource to `bslma::NewDeleteAllocator` automatically when using this component with a platform that supports C++17 `std::pmr::memory_resource`. | xref:BloombergLP/bslma/DeleteObjectProctor.adoc[`DeleteObjectProctor`] | This class implements a proctor that, unless its `release` method has previously been invoked, automatically deletes a managed object upon destruction by first invoking the object's destructor, and then invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed object of parameterized `TYPE` must have been created using memory provided by this allocator (or pool), which must remain valid throughout the lifetime of the proctor object. If `ALLOCATOR` is a non‐pointer type, it is assumed to be STL compatible; otherwise, it is assumed have a `deallocate` method with a single `void *` parameter, i.e., the same deallocation interface as `bslma::Allocator`. | xref:BloombergLP/bslma/DeleteObjectProctor_PtrType-0e.adoc[`DeleteObjectProctor_PtrType`] | This metafunction has a nested `type` that indicates the correct pointer type to use to manage an object of the specified `TYPE` template parameter allocated from an allocator having the specified `ALLOCATOR` template parameter type. This primary template yields the pointer type specified by `ALLOCATOR`, after rebinding to the specified `TYPE`. | xref:BloombergLP/bslma/DeleterHelper.adoc[`DeleterHelper`] | This struct provides a namespace for helper functions used for deleting objects in various pools and allocators. | xref:BloombergLP/bslma/DeleterHelper_Helper-0f.adoc[`DeleterHelper_Helper`] | Helper template for `DeleterHelper` dispatch by polymorphism. | xref:BloombergLP/bslma/DestructionUtil.adoc[`DestructionUtil`] | This `struct` provides a namespace for a suite of utility functions that destroy elements of the parameterized type `TYPE`. Depending on the traits of `TYPE`, the destructor may be invoked or not (i.e., optimized away as a no‐op). | xref:BloombergLP/bslma/DestructorGuard.adoc[`DestructorGuard`] | This class implements a guard that unconditionally destroys a managed object upon destruction by invoking the (managed) object's destructor. | xref:BloombergLP/bslma/DestructorProctor.adoc[`DestructorProctor`] | This class implements a proctor that, unless its `release` method has previously been invoked, automatically destroys a managed object upon destruction by invoking the (managed) object's destructor. | xref:BloombergLP/bslma/ExceptionGuard.adoc[`ExceptionGuard`] | This class provide a mechanism to verify the strong exception guarantee in exception‐throwing code. On construction, this class stores the a copy of an object of the parameterized type `OBJECT` and the address of that object. On destruction, if `release` was not invoked, it will verify the value of the object is the same as the value of the copy create on construction. This class requires the copy constructor and `operator ==` to be tested before use. | xref:BloombergLP/bslma/HasAllocatorType-00.adoc[`HasAllocatorType`] | This metafunction yields `bsl::true_type` if the specified template‐parameter `TYPE` has a nested type named `allocator_type` that meets the requirements for a C++11 allocator, and `bsl::false_type` otherwise. This primary template, yielding `false_type`, is instantiated for types for which `allocator_type` does not exist or is not an allocator type. Note that instantiation will fail if `allocator_type` exists but is not public within `TYPE` or if any of the required members of `TYPE::allocator_type` exist but are not public (though only `value_type` and `allocate` are tested at present). | xref:BloombergLP/bslma/InfrequentDeleteBlockList.adoc[`InfrequentDeleteBlockList`] | This class implements a memory manager that allocates and manages a sequence of memory blocks, each potentially of a different size as specified in the `allocate` method's invocation. This object's `release` method deallocates the entire sequence of memory blocks, as does its destructor. Note that memory blocks can not be deallocated individually. | xref:BloombergLP/bslma/IsStdAllocator-07.adoc[`IsStdAllocator`] | Metafunction to determine whether the specified template parameter `TYPE` meets the minimum requirements for a C++11 allocator. Specifically, this `struct` is derived from `true_type` if `TYPE` has a nested `value_type` and supports the operation `a.allocate(bytes)`, where `a` has type `TYPE` and `bytes` has type `allocator_traits<TYPE>::size_type`; otherwise it is derived from `false_type`. | xref:BloombergLP/bslma/IsStdAllocator_SizeType-04.adoc[`IsStdAllocator_SizeType`] | This component‐private metafunction determines the appopriate size type for a specified template parameter `TYPE`. The nested `type` typedef is `TYPE::size_type` if such a type exists and `std::size_t` otherwise. Note that this metafunction produces the same type as `bsl::allocator_traits<TYPE>::size_type`, but avoids a dependency on `bslma_allocatortraits` and is guaranteed to compile even if `TYPE` is not an allocator type. | xref:BloombergLP/bslma/MallocFreeAllocator.adoc[`MallocFreeAllocator`] | This class provides direct access to the system‐supplied (native) global `std::malloc` and `std::free`. A `static` method is provided for obtaining a unique, process wide object of this class, which is valid from the time the method is called until after the program (not just `main`) exits. | xref:BloombergLP/bslma/ManagedAllocator.adoc[`ManagedAllocator`] | Provide a protocol for allocators with the ability to `release` all memory currently allocated through the protocol back to the memory supplier of the derived concrete allocator object. | xref:BloombergLP/bslma/ManagedPtr-0fa.adoc[`ManagedPtr`] | This class is a "smart pointer" that refers to a _target_ object accessed via a pointer to the specified parameter type, `TARGET_TYPE`, and that supports sole ownership of a _managed_ object that is potentially of a different type, and may be an entirely different object from the target object. A managed pointer ensures that the object it manages is destroyed when the managed pointer is destroyed (or re‐assigned), using the "deleter" supplied along with the managed object. The target object referenced by a managed pointer may be accessed using either the `‐>` operator, or the dereference operator (`operator *`). The specified `TARGET_TYPE` may be `const`‐qualified, but may not be `volatile`‐qualified, nor may it be a reference type. | xref:BloombergLP/bslma/ManagedPtrDeleter.adoc[`ManagedPtrDeleter`] | This complex constrained in‐core value‐semantic class holds the information necessary for `ManagedPtr` to correctly manage its underlying object, namely the addresses of `object` and `factory`, and the `deleter` function, optionally supplied through the constructors or through the `set` method. This information is stored in a sub‐structure to allow the compiler to copy it more efficiently. | xref:BloombergLP/bslma/ManagedPtrNilDeleter.adoc[`ManagedPtrNilDeleter`] | This utility class provides a general no‐op deleter, which is useful when creating managed pointers to stack‐allocated objects. Note that the non‐template class `ManagedPtrUtil` should be used in preference to this deprecated class, avoiding both template bloat and undefined behavior. | xref:BloombergLP/bslma/ManagedPtrUtil.adoc[`ManagedPtrUtil`] | This utility class provides a general no‐op deleter, which is useful when creating managed pointers to stack‐allocated objects. | xref:BloombergLP/bslma/ManagedPtr_DefaultDeleter.adoc[`ManagedPtr_DefaultDeleter`] | This `struct` provides a function‐like managed pointer deleter that invokes `delete` with the passed pointer. | xref:BloombergLP/bslma/ManagedPtr_FactoryDeleter.adoc[`ManagedPtr_FactoryDeleter`] | This utility provides a general deleter for factories that provide a `deleteObject` operation (e.g., `bslma::Allocator`, `bdlma::Pool`). | xref:BloombergLP/bslma/ManagedPtr_FactoryDeleterType.adoc[`ManagedPtr_FactoryDeleterType`] | This metafunction class‐template provides a means to compute the preferred deleter function for a factory class for those methods of `ManagedPtr` that supply only a factory, and no additional deleter function. The intent is to use a common deleter function for all allocators that implement the `bslma::Allocator` protocol, rather than create a special deleter function based on the complete type of each allocator, each doing the same thing (invoking the virtual function `deleteObject`). | xref:BloombergLP/bslma/ManagedPtr_Members.adoc[`ManagedPtr_Members`] | This class provides a type‐agnostic container for managed pointer data members. This type exists so that a `ManagedPtr_Ref` (see `bslma_managedptr`) can point to the representation of a `ManagedPtr` even if the `ManagedPtr_Ref` object is instantiated on a different type than the managed pointer type (e.g., in the case of conversions or aliasing). `ManagedPtr_Members` also "erases" the type of each member, so that the same object code can be shared between all instantiations of the `ManagedPtr` class template, reducing template bloat. Note that objects of this type have an "unset" state, where the pointer member has a null value and the deleter member has an unspecified value. | xref:BloombergLP/bslma/ManagedPtr_PairProxy.adoc[`ManagedPtr_PairProxy`] | This class is a simple aggregate that may be used to construct a `bsl::pair` object. It will be a POD if the (template parameter) `ASSOCIATED_TYPE` is a POD. Note that the names of the data members must exactly match those of `bsl::pair` to support users simply acting on the result of a function call from which a pair proxy is returned, and not assigning that result to a `bsl::pair` first. | xref:BloombergLP/bslma/ManagedPtr_Ref.adoc[`ManagedPtr_Ref`] | This class holds a managed pointer reference, returned by the implicit conversion operator in the class `ManagedPtr`. This class is used to allow the construction of managed pointers from temporary managed pointer objects, since temporaries cannot bind to the reference to a modifiable object used in the copy constructor and copy‐assignment operator for `ManagedPtr`. Note that while no members or methods of this class template depend on the specified `TARGET_TYPE`, it is important to carry this type into conversions to support passing ownership of `ManagedPtr_Members` pointers when assigning or constructing `ManagedPtr` objects. | xref:BloombergLP/bslma/ManagedPtr_TraitConstraint.adoc[`ManagedPtr_TraitConstraint`] | This `struct` is an empty type that exists solely to enable constructor access to be constrained by type trait. | xref:BloombergLP/bslma/MemoryResourceImpSupport.adoc[`MemoryResourceImpSupport`] | Namespace for functions that support implementing a memory resource. | xref:BloombergLP/bslma/MemoryResourceImpSupport_AlignedData.adoc[`MemoryResourceImpSupport_AlignedData`] | COMPONENT‐PRIVATE struct ‐‐ DO NOT USE. Maximally aligned `struct` holding an unsigned 64‐bit integer. This `struct` is exposed in the component header so that `MemoryResourceImpSupport::singularPointer` can be implemented as `constexpr` and `inline`. | xref:BloombergLP/bslma/NewDeleteAllocator.adoc[`NewDeleteAllocator`] | This class defines a concrete mechanism that adapts the system‐supplied (native) global `operator new` and `operator delete` to the `Allocator` protocol. The class method `singleton` returns a process‐wide unique object of this class whose lifetime is guaranteed to extend from the first call to `singleton` until the program terminates. A second class method, `allocator`, allows for conveniently replacing a "null" allocator with this singleton object. Note that this entire class should generally not be used directly by typical clients (see `bslma_default` for more information). | xref:BloombergLP/bslma/PointerUtil.adoc[`PointerUtil`] | This `struct` provides a namespace for utility functions that perform low‐level pointer manipulations. | xref:BloombergLP/bslma/RawDeleterGuard.adoc[`RawDeleterGuard`] | This class implements a guard that unconditionally deletes a managed object upon destruction by first invoking the object's destructor, and then invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed object of parameterized `TYPE` must have been created using memory provided by this allocator (or pool), which must remain valid throughout the lifetime of the guard object. | xref:BloombergLP/bslma/RawDeleterProctor.adoc[`RawDeleterProctor`] | This class implements a proctor that, unless its `release` method has previously been invoked, automatically deletes a managed object upon destruction by first invoking the object's destructor, and then invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. The managed object of parameterized `TYPE` must have been created using memory provided by this allocator (or pool), which must remain valid throughout the lifetime of the proctor object. | xref:BloombergLP/bslma/SequentialAllocator.adoc[`SequentialAllocator`] | This class implements the `ManagedAllocator` protocol to provide a fast allocator of arbitrarily‐sized blocks of memory. Both the `release` method and the destructor atomically delete all memory managed by this allocator; the `deallocate` method, however, has no effect for this class. | xref:BloombergLP/bslma/SequentialPool.adoc[`SequentialPool`] | This class implements a memory pool that dispenses arbitrarily‐sized blocks of memory from an internal buffer or an optionally user‐supplied buffer. If an allocation request exceeds the remaining free memory space in the current buffer, the pool either replenishes its buffer with new memory to satisfy the request, or returns a separate memory block, depending on whether the request size exceeds an optionally specified maximum buffer size. By default, buffer growth is not capped. The `release` method releases all memory allocated through this pool, as does the destructor. Note, however, that individual allocated blocks of memory cannot be individually deallocated. | xref:BloombergLP/bslma/SharedPtrInplaceRep.adoc[`SharedPtrInplaceRep`] | This class provides a concrete implementation of the `SharedPtrRep` protocol for "in‐place" instances of the parameterized `TYPE`. Upon destruction of this object, the destructor of `TYPE` is invoked. | xref:BloombergLP/bslma/SharedPtrOutofplaceRep.adoc[`SharedPtrOutofplaceRep`] | This class provides a concrete implementation of the `SharedPtrRep` protocol for out‐of‐place instances of the parameterized `TYPE`. Upon destruction of this object, the parameterized `DELETER` type is invoked on the pointer to the shared object. | xref:BloombergLP/bslma/SharedPtrOutofplaceRep_DeleterDiscriminator.adoc[`SharedPtrOutofplaceRep_DeleterDiscriminator`] | This `class` provides two meta‐functions for determining the enumerated type and the C++ type of a deleter based on whether it is a pointer to a function, a pointer to a factory deleter, or an instance of a function‐like deleter. | xref:BloombergLP/bslma/SharedPtrOutofplaceRep_DeleterHelper.adoc[`SharedPtrOutofplaceRep_DeleterHelper`] | This `struct` provides utility functions to apply a deleter to a shared object referred to by `SharedPtrOutofplaceRep`. | xref:BloombergLP/bslma/SharedPtrOutofplaceRep_DeleterType.adoc[`SharedPtrOutofplaceRep_DeleterType`] | This `struct` enumerates four kinds of deleters, the first two are factory deleters, and the last two are function‐like deleters. | xref:BloombergLP/bslma/SharedPtrOutofplaceRep_InitProctor.adoc[`SharedPtrOutofplaceRep_InitProctor`] | This proctor is used for out‐of‐place shared pointer instantiations. Generally, a proctor is created prior to constructing a `SharedPtrOutofplaceRep` and released after successful construction. In the event that an exception is thrown during construction of the representation, the proctor will delete the provided pointer using the provided deleter. Note that the provided deleter is held by reference and must remain valid for the lifetime of the proctor. If the proctor is not released before it's destruction, a copy of the deleter is instantiated to delete the pointer (in case `operator()` is non‐`const`). Also note that if the deleter throws during copy construction, the provided pointer will not be destroyed. | xref:BloombergLP/bslma/SharedPtrRep.adoc[`SharedPtrRep`] | This class provides a partially implemented shared pointer representation ("letter") protocol. The class provides two counters for storing the number of shared and weak references, and functions to increment and decrement these counters. In addition, this class provides protocol methods that allow concrete implementations to specify what action should be taken when these counts reach zero. The function `disposeRep` is responsible for destroying this object, it is called when the reference count to this object reaches zero. Thus, the destructor of this object is declared as protected and should never be invoked. | xref:BloombergLP/bslma/StdTestAllocator.adoc[`StdTestAllocator`] | An STL‐compatible test allocator that forwards allocation calls to an underlying mechanism object of a type derived from `bslma::TestAllocator`. This class template adheres to the allocator requirements defined in section 20.1.5 [lib.allocator.requirements]of the C++ standard and may be used to instantiate any [container]class template that follows the STL allocator protocol. The allocation mechanism is chosen at run‐time, giving the programmer run‐time control over how a container allocates and frees memory. | xref:BloombergLP/bslma/SuppressesImplicitConvertibilityWarnings.adoc[`SuppressesImplicitConvertibilityWarnings`] | This `struct` template implements a meta‐function to determine whether a deprecation warning emitted for allocator‐aware types that have an implicit conversion constructor from `Allocator*`, should be suppressed for (template parameter) `t_TYPE`. This `struct` derives from `bsl::true_type` if the warning should be suppressed and from `bsl::false_type` otherwise. Note that this meta‐function is used for testing to disable the warnings generated by this component when deliberately testing the deprecated feature. | xref:BloombergLP/bslma/TestAllocator.adoc[`TestAllocator`] | This class defines a concrete "test" allocator mechanism that implements the `Allocator` protocol, and provides instrumentation to track (1) the number of blocks/bytes currently in use, (2) the maximum number of blocks/bytes that have been outstanding at any one time, and (3) the cumulative number of blocks/bytes that have ever been allocated by this test allocator object. The accumulated statistics are based solely on the number of bytes requested. Additional testing facilities include allocation limits, verbosity modes, status, and automated report printing. | xref:BloombergLP/bslma/TestAllocatorException.adoc[`TestAllocatorException`] | This class defines an exception object for memory allocation operations. Objects of this class contain information about an allocation request. | xref:BloombergLP/bslma/TestAllocatorMonitor.adoc[`TestAllocatorMonitor`] | This mechanism provides a set of boolean accessor methods indicating whether a change has occurred in the state of the `TestAllocator` object (supplied at construction) since the construction of the monitor. See the section for the statics tracked. | xref:BloombergLP/bslma/TestAllocatorStashedStatistics.adoc[`TestAllocatorStashedStatistics`] | This simple unconstrained attribute type is used to store all information necessary to restore the state of all statistics of a `TestAllocator` after a `stashStatistics()` call that resets them. See also `TestAllocator::stashStatistics` and `TestAllocator::restoreStatistics`. | xref:BloombergLP/bslma/TestAllocatorStatisticsGuard.adoc[`TestAllocatorStatisticsGuard`] | This mechanism provides the means to get localized `TestAllocator` statistics in a scope since the construction of the guard, and also reinstates the statistics upon its destruction as if the local reset has not happened. See the section for the statistics managed. | xref:BloombergLP/bslma/TestAllocator_BlockHeader.adoc[`TestAllocator_BlockHeader`] | Private header for a block of allocated memory managed by `TestAllocator`. | xref:BloombergLP/bslma/TestAllocator_Proxy.adoc[`TestAllocator_Proxy`] | This class provides a proxy to the test allocator that is supplied to the `BSLMA_TESTALLOCATOR_EXCEPTION_TEST_BEGIN` macro. This proxy may be instantiated with `TestAllocator`, or with a type that supports the same interface as `TestAllocator`. | xref:BloombergLP/bslma/TestAllocator_ProxyBase.adoc[`TestAllocator_ProxyBase`] | This class provides a common base class for the parameterized `TestAllocator_Proxy` class (below). Note that the `virtual` `setAllocationLimit` method, although a "setter", _must_ be declared `const`. | xref:BloombergLP/bslma/UsesBslmaAllocator-020.adoc[`UsesBslmaAllocator`] | This metafunction is derived from `true_type` if `TYPE` adheres to the `bslma` allocator usage idiom and `false_type` otherwise. Note that this trait must be explicitly associated with a type in order for this metafunction to return true; simply having a constructor that implicitly converts `bslma::Allocator *` to `TYPE` is deprecated as a means of indicating that a type follows the `bslma` allocator usage idiom. | xref:BloombergLP/bslma/UsesBslmaAllocator_DeprecatedIf-0f.adoc[`UsesBslmaAllocator_DeprecatedIf`] | For compilers that support a deprecation annotation, this empty `struct` has a static `check` function that yields a deprecation warning when called (including within an unevaluated context) if this class is instantiated with a `true` argument, but not if instantiated with a `false` argument. | xref:BloombergLP/bslma/UsesBslmaAllocator_Sniff-0d.adoc[`UsesBslmaAllocator_Sniff`] | This class has a constant `value` that is `true` if the specified `TYPE` is implicitly convertible from `bslma::Allocator *`. It thus "sniffs" whether `UsesBslmaAllocator<TYPE>::value` should be `true`. If the specified `BYPASS` parameter is `true`, the conversion check is skipped and `value` is hard‐coded to `true`. The bypass is needed because the xlC compiler will sometimes instantiate the copy constructor for `TYPE`, leading to compilation errors if `TYPE` is not copy constructible. This automatic sniffing is deprecated; having a type implicitly convertible from an allocator pointer is discouraged. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/AllocatorAdaptor.adoc[`AllocatorAdaptor`] | Polymorphic wrapper around an STL‐style allocator. Note that `AllocatorAdaptor[::Type]` is the same type regardless of whether or not the compiler supports alias templates. It should be used, therefore, whenever the exact type of the adaptor is important. |=== == Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/TestAllocator_getProxy.adoc[`TestAllocator_getProxy`] | Return, by value, a test allocator proxy for the specified parameterized `allocator`. | xref:BloombergLP/bslma/swap.adoc[`swap`] | Efficiently exchange the values of the specified `a` and `b` objects. This function provides the no‐throw exception‐safety guarantee. | xref:BloombergLP/bslma/operator_lshift.adoc[`operator<<`] | Write the accumulated state information held in the specified allocator `ta` to the specified `stream` in a reasonable (multi‐line) format identical to the format produced by `ta.print()` and return a reference offering modifiable access to `stream`. Output is performed via calls to `stream.write(s, count)`, where `write` is a required method of class `t_OS`, `s` is a `const char*` holding the formatted output, and `count` is the length of `s` excluding any null terminator. Note that `std::ostream` meets the requirements for `t_OS`. | xref:BloombergLP/bslma/operator_eq-03.adoc[`operator==`] | Equality operators | xref:BloombergLP/bslma/operator_not_eq-09.adoc[`operator!=`] | Inequality operators |=== == Variables [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/IsStdAllocator_v.adoc[`IsStdAllocator_v`] | This template variable represents the result value of the `bslma::IsStdAllocator` meta‐function. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#