Metafunction that yields whether TYPE has a nested C++11 allocator_type.

Synopsis

Declared in <bslma_hasallocatortype.h>

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

Description

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).

Base Classes

Name

Description

bsl::false_type

Metafunction representing the boolean constant false.

Specializations

Name

Description

HasAllocatorType<TYPE, bsl::void_t<TYPE::allocator_type>>

Partial specialization of HasAllocatorType for types with a C++11 allocator_type.

Created with MrDocs