1 .. Metafunctions/Type Selection//eval_if_c |40
18 typedef |unspecified| type;
26 Evaluates one of its two |nullary metafunction| arguments, ``F1`` or ``F2``, depending
27 on the value of integral constant ``c``. ``eval_if_c<c,f1,f2>::type`` is a shorcut
28 notation for ``eval_if< bool_<c>,f1,f2 >::type``.
36 #include <boost/mpl/eval_if.hpp>
42 +---------------+-----------------------------------+-----------------------------------------------+
43 | Parameter | Requirement | Description |
44 +===============+===================================+===============================================+
45 | ``c`` | An integral constant | An evaluation condition. |
46 +---------------+-----------------------------------+-----------------------------------------------+
47 | ``F1``, ``F2``| Nullary |Metafunction| | Metafunctions to select for evaluation from. |
48 +---------------+-----------------------------------+-----------------------------------------------+
54 For any integral constant ``c`` and nullary |Metafunction|\ s ``f1``, ``f2``:
59 typedef eval_if_c<c,f1,f2>::type t;
65 Equivalent to ``typedef eval_if< bool_<c>,f1,f2 >::type t;``
73 typedef eval_if_c< true, identity<char>, identity<long> >::type t1;
74 typedef eval_if_c< false, identity<char>, identity<long> >::type t2;
76 BOOST_MPL_ASSERT(( is_same<t1,char> ));
77 BOOST_MPL_ASSERT(( is_same<t2,long> ));
83 |Metafunctions|, |Integral Constant|, |eval_if|, |if_|, |bool_|
86 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
87 Distributed under the Boost Software License, Version 1.0. (See accompanying
88 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)