...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Front Page / Metafunctions / Type Selection / eval_if |
template< typename C , typename F1 , typename F2 > struct eval_if { typedef unspecified type; };
Evaluates one of its two nullary-metafunction arguments, F1 or F2, depending on the value C.
#include <boost/mpl/eval_if.hpp>
Parameter | Requirement | Description |
---|---|---|
C | Integral Constant | An evaluation condition. |
F1, F2 | Nullary Metafunction | Metafunctions to select for evaluation from. |
For any Integral Constant c and nullary Metafunctions f1, f2:
typedef eval_if<c,f1,f2>::type t;
Return type: | Any type. |
---|---|
Semantics: | If c::value == true, t is identical to f1::type; otherwise t is identical to f2::type. |