Back to Arangodb

eval_if_c

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

3.12.9.12.5 KB
Original Source

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

eval_if_c

Synopsis

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

Description

Evaluates one of its two nullary-metafunction arguments, F1 or F2, depending on the value of integral constant c. eval_if_c<c,f1,f2>::type is a shorcut notation for eval_if< bool_<c>,f1,f2 >::type.

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

Parameters

ParameterRequirementDescription
cAn integral 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\_c](./eval-if-c.html)<c,f1,f2>::type t;

| Return type: | Any type. | | Semantics: | Equivalent to typedef eval_if< bool_<c>,f1,f2 >::type t; |

Example

typedef[eval\_if\_c](./eval-if-c.html)< true,[identity](./identity.html)<char>,[identity](./identity.html)<long> >::type t1;
typedef[eval\_if\_c](./eval-if-c.html)< false,[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, if_, bool_

| 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) |