1 // (C) Copyright Jeremy Siek 2000.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 // This header replaces the implementation of ct_if that preceded the
7 // introduction of Boost.MPL with a facade that defers to that reviewed and
10 // Author: Ronald Garcia
11 // Date: 20 October, 2006
14 #ifndef BOOST_CT_IF_HPP
15 #define BOOST_CT_IF_HPP
18 // A stub implementation in terms of Boost.MPL
20 #include <boost/mpl/if.hpp>
21 #include <boost/mpl/not.hpp>
22 #include <boost/mpl/and.hpp>
23 // true_type and false_type are used by applications of ct_if
24 #include <boost/type_traits/integral_constant.hpp>
28 template <class A
, class B
>
29 struct ct_and
: boost::mpl::and_
<A
,B
> {};
32 struct ct_not
: mpl::not_
<A
> {};
34 template <bool cond
, class A
, class B
>
35 struct ct_if
: mpl::if_c
<cond
,A
,B
> {};
37 template <class cond
, class A
, class B
>
38 struct ct_if_t
: mpl::if_
<cond
,A
,B
> {};
42 #endif // BOOST_CT_IF_HPP