BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslalg::SelectTrait< TYPE, TRAIT1, TRAIT2, TRAIT3, TRAIT4, TRAIT5 > Struct Template Reference

#include <bslalg_selecttrait.h>

Public Types

enum  { SELECTION }
 
typedef bslmf::Switch< SELECTION, TypeTraitNil, TRAIT1, TRAIT2, TRAIT3, TRAIT4, TRAIT5 >::Type Type
 

Detailed Description

template<class TYPE, class TRAIT1, class TRAIT2 = TypeTraitNil, class TRAIT3 = TypeTraitNil, class TRAIT4 = TypeTraitNil, class TRAIT5 = TypeTraitNil>
struct bslalg::SelectTrait< TYPE, TRAIT1, TRAIT2, TRAIT3, TRAIT4, TRAIT5 >

Select one trait out of several that the parameterized type T may possess. If T has the parameterized trait TRAIT1, then the nested Type is TRAIT1, else if T has an optionally parameterized TRAIT2, then Type is TRAIT2, etc. Also computes an integral selection constant and meta-value. If T has none of the parameterized TRAIT*, then the nested Type is TypeTraitNil.

Member Typedef Documentation

◆ Type

template<class TYPE , class TRAIT1 , class TRAIT2 = TypeTraitNil, class TRAIT3 = TypeTraitNil, class TRAIT4 = TypeTraitNil, class TRAIT5 = TypeTraitNil>
typedef bslmf::Switch<SELECTION,TypeTraitNil,TRAIT1,TRAIT2,TRAIT3,TRAIT4,TRAIT5>::Type bslalg::SelectTrait< TYPE, TRAIT1, TRAIT2, TRAIT3, TRAIT4, TRAIT5 >::Type

The actual trait that was selected, or TypeTraitNil if no trait was selected.

Member Enumeration Documentation

◆ anonymous enum

template<class TYPE , class TRAIT1 , class TRAIT2 = TypeTraitNil, class TRAIT3 = TypeTraitNil, class TRAIT4 = TypeTraitNil, class TRAIT5 = TypeTraitNil>
anonymous enum
Enumerator
SELECTION 

Integral value indicating which trait was selected: 1 for TRAIT1, 2 for TRAIT2, etc., and 0 if none were selected.


The documentation for this struct was generated from the following file: