|
BDE 4.14.0 Production release
|
Macros | |
| #define | BSLMF_TAG_TO_UINT(BSLMF_EXPR) |
| #define | BSLMF_TAG_TO_INT(BSLMF_EXPR) ((int)BSLMF_TAG_TO_UINT(BSLMF_EXPR)) |
| #define | BSLMF_TAG_TO_BOOL(BSLMF_EXPR) (BSLMF_TAG_TO_INT(BSLMF_EXPR) != 0) |
| #define | bslmf_Tag bslmf::Tag |
| This alias is defined for backward compatibility. | |
Provide an integral-constant-to-type conversion.
: BSLMF_TAG_TO_INT(EXPR): map tag to integral value : BSLMF_TAG_TO_BOOL(EXPR): map tag to boolean value
This component defines a simple template structure used to map an integral constant to a C++ type. bslmf::Tag<unsigned> defines a different type for each distinct compile-time constant integral parameter. That is, instantiations with different integer values form distinct types, so that bslmf::Tag<0> is a distinct type from bslmf::Tag<1>, which, in turn, is also distinct from bslmf::Tag<2>, and so on.
This component also provides two macros for mapping a bslmf::Tag<t_N> instance to the integral value t_N (BSLMF_TAG_TO_INT), and to the boolean value t_N != 0 (BSLMF_TAG_TO_BOOL).
This section provides a brief description of the macros defined in this component.
BSLMF_TAG_TO_INT(EXPR) Given an integral value, V, and an expression, EXPR, of type bslmf::Tag<V>, this macro returns a compile-time constant with the value V. EXPR is not evaluated at run-time.
BSLMF_TAG_TO_BOOL(EXPR) Given an integral value, V, and an expression, EXPR, of type bslmf::Tag<V>, this macro returns a compile-time constant with the value true or false, depending on the boolean value of V. EXPR is not evaluated at run-time.
| #define bslmf_Tag bslmf::Tag |
| #define BSLMF_TAG_TO_BOOL | ( | BSLMF_EXPR | ) | (BSLMF_TAG_TO_INT(BSLMF_EXPR) != 0) |
| #define BSLMF_TAG_TO_INT | ( | BSLMF_EXPR | ) | ((int)BSLMF_TAG_TO_UINT(BSLMF_EXPR)) |
| #define BSLMF_TAG_TO_UINT | ( | BSLMF_EXPR | ) |