1 .. Metafunctions/Type Selection//eval_if |30
18 typedef |unspecified| type;
26 Evaluates one of its two |nullary metafunction| arguments, ``F1`` or ``F2``, depending
35 #include <boost/mpl/eval_if.hpp>
41 +---------------+-----------------------------------+-----------------------------------------------+
42 | Parameter | Requirement | Description |
43 +===============+===================================+===============================================+
44 | ``C`` | |Integral Constant| | An evaluation condition. |
45 +---------------+-----------------------------------+-----------------------------------------------+
46 | ``F1``, ``F2``| Nullary |Metafunction| | Metafunctions to select for evaluation from. |
47 +---------------+-----------------------------------+-----------------------------------------------+
53 For any |Integral Constant| ``c`` and nullary |Metafunction|\ s ``f1``, ``f2``:
58 typedef eval_if<c,f1,f2>::type t;
64 If ``c::value == true``, ``t`` is identical to ``f1::type``; otherwise ``t`` is
65 identical to ``f2::type``.
73 typedef eval_if< true\_, identity<char>, identity<long> >::type t1;
74 typedef eval_if< 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_c|, |if_|
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)