Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:50

0001 // (C) Copyright 2008 CodeRage, LLC (turkanis at coderage dot com)
0002 // (C) Copyright 2003-2007 Jonathan Turkanis
0003 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.)
0005 
0006 // See http://www.boost.org/libs/iostreams for documentation.
0007 
0008 // Contains the metafunction select, which mimics the effect of a chain of
0009 // nested mpl if_'s.
0010 //
0011 // -----------------------------------------------------------------------------
0012 //
0013 // Usage:
0014 //      
0015 // typedef typename select<
0016 //                      case1,  type1,
0017 //                      case2,  type2,
0018 //                      ...
0019 //                      true_,  typen
0020 //                  >::type selection;
0021 //
0022 // Here case1, case2, ... are models of MPL::IntegralConstant with value type
0023 // bool, and n <= 12.
0024 
0025 #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED
0026 #define BOOST_IOSTREAMS_SELECT_HPP_INCLUDED   
0027 
0028 #if defined(_MSC_VER)
0029 # pragma once
0030 #endif                  
0031  
0032 #include <boost/type_traits/is_base_and_derived.hpp>
0033 #include <boost/mpl/eval_if.hpp>
0034 #include <boost/mpl/identity.hpp>
0035 #include <boost/mpl/if.hpp>
0036 #include <boost/mpl/void.hpp>
0037 
0038 namespace boost { namespace iostreams { 
0039 
0040 typedef mpl::true_ else_;
0041 
0042 template< typename Case1 = mpl::true_,
0043           typename Type1 = mpl::void_,
0044           typename Case2 = mpl::true_,
0045           typename Type2 = mpl::void_,
0046           typename Case3 = mpl::true_,
0047           typename Type3 = mpl::void_,
0048           typename Case4 = mpl::true_,
0049           typename Type4 = mpl::void_,
0050           typename Case5 = mpl::true_,
0051           typename Type5 = mpl::void_,
0052           typename Case6 = mpl::true_,
0053           typename Type6 = mpl::void_,
0054           typename Case7 = mpl::true_,
0055           typename Type7 = mpl::void_,
0056           typename Case8 = mpl::true_,
0057           typename Type8 = mpl::void_,
0058           typename Case9 = mpl::true_,
0059           typename Type9 = mpl::void_,
0060           typename Case10 = mpl::true_,
0061           typename Type10 = mpl::void_,
0062           typename Case11 = mpl::true_,
0063           typename Type11 = mpl::void_,
0064           typename Case12 = mpl::true_,
0065           typename Type12 = mpl::void_ >
0066 struct select {
0067     typedef typename
0068             mpl::eval_if<
0069                 Case1, mpl::identity<Type1>, mpl::eval_if<
0070                 Case2, mpl::identity<Type2>, mpl::eval_if<
0071                 Case3, mpl::identity<Type3>, mpl::eval_if<
0072                 Case4, mpl::identity<Type4>, mpl::eval_if<
0073                 Case5, mpl::identity<Type5>, mpl::eval_if<
0074                 Case6, mpl::identity<Type6>, mpl::eval_if<
0075                 Case7, mpl::identity<Type7>, mpl::eval_if<
0076                 Case8, mpl::identity<Type8>, mpl::eval_if<
0077                 Case9, mpl::identity<Type9>, mpl::eval_if<
0078                 Case10, mpl::identity<Type10>, mpl::eval_if<
0079                 Case11, mpl::identity<Type11>, mpl::if_<
0080                 Case12, Type12, mpl::void_ > > > > > > > > > > >
0081             >::type type;
0082 };
0083 
0084 } } // End namespaces iostreams, boost.
0085 
0086 #endif // #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED