BloombergLP::bslmf::SelectTraitCase

This template expresses a class that is unique for the specified (template parameter) t_TRAIT metafunction. An instantiation of this template is the "compile-time return value" of SelectTrait (see below). SelectTraitCase acts as a sort of compile-time pointer-to-metafunction that holds the identity of a metafunction similar to the way a pointer-to-function holds (at run-time) the identity of a function. As in the pointer-to-function case, a SelectTraitCase can also be used indirectly to evaluate t_TRAIT (at compile time). Also note that, when SelectTraitCase is specialized with the default t_TRAIT type parameter, SelectTrait_False, it essentially means that none of the traits specified to SelectTrait match.

Synopsis

Declared in <bslmf_selecttrait.h>

template<template<class> typename t_TRAIT = SelectTrait_False>
struct SelectTraitCase;

Types

NameDescription
Eval Evaluates t_TRAIT for the specified (template parameter) T type. The resulting Eval<T> instantiation is derived from true_type if t_TRAIT<T> is derived from true_type and false_type if t_TRAIT<T> is derived from false_type. (More generally, Eval<T> is derived from t_TRAIT<T>::type.)

Type Aliases

NameDescription
Type Alias for the selected trait case type.