BloombergLP::bslma::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).

Synopsis

Declared in <bslma_hasallocatortype.h>

template<
    class TYPE,
    class = void>
struct HasAllocatorType
    : bsl::false_type

Base Classes

NameDescription
bsl::false_typeMetafunction representing the boolean constant false.

Specializations

NameDescription
HasAllocatorType<TYPE, bsl::void_t<TYPE::allocator_type>> Partial specialization of HasAllocatorType yielding true_type is instantiated for TYPEs that do have an allocator_type member that meets the requirements of a C++11 allocator type.