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.

Synopsis

Declared in <bslma_isstdallocator.h>

template<class TYPE>
struct IsStdAllocator
    : /* implementation-defined */::type

Base Classes

Name

Description

/* implementation-defined */::type

Specializations

Name

Description

IsStdAllocator<bsl::allocator<void>>

bsl::allocator<void> is not an allocator type, even though all other instantiations are allocator types.

IsStdAllocator<std::allocator<void>>

std::allocator<void> is not an allocator type, even though all other specializations are allocator types.

IsStdAllocator<bsl::allocator<TYPE>>

A bsl::allocator inherits its allocate method from a base class, which causes IsStdAllocator to fail the auto‐detected it.

IsStdAllocator<std::allocator<TYPE>>

Specialization for std::allocator.

IsStdAllocator<bsl::polymorphic_allocator<TYPE>>

Declare polymorphic_allocator as a C++11 compatible allocator for all versions of C++.

IsStdAllocator<TYPE&>

Specialization for lvalue reference types.

IsStdAllocator<TYPE&&>

Specialization for rvalue reference types.

Created with MrDocs