Back to Arangodb

eval_if

3rdParty/boost/1.78.0/libs/mpl/doc/refmanual/eval-if.html

3.12.9.12.4 KB
Original Source

| Prev Next | Back Along | Up Home | Full TOC | Front Page / Metafunctions / Type Selection / eval_if |

eval_if

Synopsis

template<
      typename C
    , typename F1
    , typename F2
    >
struct[eval\_if](./eval-if.html){
    typedef_unspecified_type;
};

Description

Evaluates one of its two nullary-metafunction arguments, F1 or F2, depending on the value C.

#include <[boost/mpl/eval\_if.hpp](../../../../boost/mpl/eval_if.hpp)>

Parameters

ParameterRequirementDescription
CIntegral ConstantAn evaluation condition.
F1, F2Nullary MetafunctionMetafunctions to select for evaluation from.

Expression semantics

For any Integral Constant c and nullary Metafunctions f1, f2:

typedef[eval\_if](./eval-if.html)<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. |

Example

typedef[eval\_if](./eval-if.html)<[true\_](./bool.html),[identity](./identity.html)<char>,[identity](./identity.html)<long> >::type t1;
typedef[eval\_if](./eval-if.html)<[false\_](./bool.html),[identity](./identity.html)<char>,[identity](./identity.html)<long> >::type t2;[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<t1,char> ));[BOOST\_MPL\_ASSERT](./assert.html)(( is_same<t2,long> ));

See also

Metafunctions, Integral Constant, eval_if_c, if_

| Prev Next | Back Along | Up Home | Full TOC |

Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |