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

Synopsis

Declared in <bslma_aamodel.h>

template<
    class TYPE,
    class MODEL>
struct AAModelIsSupported
    : bsl::false_type

Base Classes

NameDescription
bsl::false_typeMetafunction representing the boolean constant false.

Specializations

NameDescription
AAModelIsSupported<TYPE, AAModelBsl> Specialization of AAModelIsSupported for MODEL == AAModelBsl, yielding true_type if TYPE::allocator_type exists and is convertible from bsl::allocator<char>.
AAModelIsSupported<TYPE, AAModelLegacy> Specialization of AAModelIsSupported for MODEL == AAModelStl, yielding true_type if TYPE can use bslma::Allocator * as its memory resource. Specifically, it is true if UsesBslmaAllocator<TYPE> is true or if TYPE::allocator_type exists and is convertible from bslma::Allocator *.
AAModelIsSupported<TYPE, AAModelNone> Specialization of AAModelIsSupported for MODEL == AAModelNone, always yielding true_type.
AAModelIsSupported<TYPE, AAModelPmr> Specialization of AAModelIsSupported for MODEL == AAModelPmr, yielding true_type if TYPE::allocator_type exists and is convertible from bsl::polymorphic_allocator<char>.
AAModelIsSupported<TYPE, AAModelStl> Specialization of AAModelIsSupported for MODEL == AAModelStl, yielding true_type if TYPE::allocator_type exists; otherwise, yielding false_type unless AAModelIsSupported<TYPE, AAModelBsl> is true. The latter condition exists so that bsl-AA always implies stl-AA even if AAModelIsSupported<TYPE, AAModelBsl> is explicitly specialized to true for a type that does not have an allocator_type member.