template <class C, class T, class F>
struct if_
{
// unspecified
};
Evaluates the nullary metafunction C
, and when it returns a true logical value, if_
returns the result of the nullary metafunction T
, when C
returns false, if_
returns the result of the nullary metafunction F
.
#include <mpllibs/metamonad/if_.hpp>
For any ct
nullary metafunction evaluating to true, cf
nullary metafunction evaluating to false and t
, f
nullary metafunctions the following are equivalent:
if_<ct, t, f>::type
t::type
if_<cf, t, f>::type
f::type
MPLLIBS_METAFUNCTION(divide_if_not_zero, (A)(B))
((
if_<
boost::mpl::equal_to<boost::mpl::int_<0>, B>,
A,
boost::mpl::divides<A, B>
>
));
Copyright Abel Sinkovics (abel at elte dot hu) 2011. 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