First public contribution.
1 // (C) Copyright Jonathan Turkanis 2003.
2 // Distributed under the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
5 // See http://www.boost.org/libs/iostreams for documentation.
7 // Contains the metafunction select, which mimics the effect of a chain of
10 // -----------------------------------------------------------------------------
14 // typedef typename select<
21 // Here case1, case2, ... are models of MPL::IntegralConstant with value type
24 #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED
25 #define BOOST_IOSTREAMS_SELECT_HPP_INCLUDED
27 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
31 #include <boost/type_traits/is_base_and_derived.hpp>
32 #include <boost/mpl/eval_if.hpp>
33 #include <boost/mpl/identity.hpp>
34 #include <boost/mpl/if.hpp>
35 #include <boost/mpl/void.hpp>
37 namespace boost { namespace iostreams {
39 typedef mpl::true_ else_;
41 template< typename Case1 = mpl::true_,
42 typename Type1 = mpl::void_,
43 typename Case2 = mpl::true_,
44 typename Type2 = mpl::void_,
45 typename Case3 = mpl::true_,
46 typename Type3 = mpl::void_,
47 typename Case4 = mpl::true_,
48 typename Type4 = mpl::void_,
49 typename Case5 = mpl::true_,
50 typename Type5 = mpl::void_,
51 typename Case6 = mpl::true_,
52 typename Type6 = mpl::void_,
53 typename Case7 = mpl::true_,
54 typename Type7 = mpl::void_,
55 typename Case8 = mpl::true_,
56 typename Type8 = mpl::void_,
57 typename Case9 = mpl::true_,
58 typename Type9 = mpl::void_,
59 typename Case10 = mpl::true_,
60 typename Type10 = mpl::void_ >
64 Case1, mpl::identity<Type1>, mpl::eval_if<
65 Case2, mpl::identity<Type2>, mpl::eval_if<
66 Case3, mpl::identity<Type3>, mpl::eval_if<
67 Case4, mpl::identity<Type4>, mpl::eval_if<
68 Case5, mpl::identity<Type5>, mpl::eval_if<
69 Case6, mpl::identity<Type6>, mpl::eval_if<
70 Case7, mpl::identity<Type7>, mpl::eval_if<
71 Case8, mpl::identity<Type8>, mpl::eval_if<
72 Case9, mpl::identity<Type9>, mpl::if_<
73 Case10, Type10, mpl::void_ > > > > > > > > >
77 } } // End namespaces iostreams, boost.
79 #endif // #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED