sl@0: // (C) Copyright Jonathan Turkanis 2003. sl@0: // Distributed under the Boost Software License, Version 1.0. (See accompanying sl@0: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) sl@0: sl@0: // See http://www.boost.org/libs/iostreams for documentation. sl@0: sl@0: // Contains the metafunction select, which mimics the effect of a chain of sl@0: // nested mpl if_'s. sl@0: // sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: // Usage: sl@0: // sl@0: // typedef typename select< sl@0: // case1, type1, sl@0: // case2, type2, sl@0: // ... sl@0: // true_, typen sl@0: // >::type selection; sl@0: // sl@0: // Here case1, case2, ... are models of MPL::IntegralConstant with value type sl@0: // bool, and n <= 10. sl@0: sl@0: #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED sl@0: #define BOOST_IOSTREAMS_SELECT_HPP_INCLUDED sl@0: sl@0: #if defined(_MSC_VER) && (_MSC_VER >= 1020) sl@0: # pragma once sl@0: #endif sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: namespace boost { namespace iostreams { sl@0: sl@0: typedef mpl::true_ else_; sl@0: sl@0: template< typename Case1 = mpl::true_, sl@0: typename Type1 = mpl::void_, sl@0: typename Case2 = mpl::true_, sl@0: typename Type2 = mpl::void_, sl@0: typename Case3 = mpl::true_, sl@0: typename Type3 = mpl::void_, sl@0: typename Case4 = mpl::true_, sl@0: typename Type4 = mpl::void_, sl@0: typename Case5 = mpl::true_, sl@0: typename Type5 = mpl::void_, sl@0: typename Case6 = mpl::true_, sl@0: typename Type6 = mpl::void_, sl@0: typename Case7 = mpl::true_, sl@0: typename Type7 = mpl::void_, sl@0: typename Case8 = mpl::true_, sl@0: typename Type8 = mpl::void_, sl@0: typename Case9 = mpl::true_, sl@0: typename Type9 = mpl::void_, sl@0: typename Case10 = mpl::true_, sl@0: typename Type10 = mpl::void_ > sl@0: struct select { sl@0: typedef typename sl@0: mpl::eval_if< sl@0: Case1, mpl::identity, mpl::eval_if< sl@0: Case2, mpl::identity, mpl::eval_if< sl@0: Case3, mpl::identity, mpl::eval_if< sl@0: Case4, mpl::identity, mpl::eval_if< sl@0: Case5, mpl::identity, mpl::eval_if< sl@0: Case6, mpl::identity, mpl::eval_if< sl@0: Case7, mpl::identity, mpl::eval_if< sl@0: Case8, mpl::identity, mpl::eval_if< sl@0: Case9, mpl::identity, mpl::if_< sl@0: Case10, Type10, mpl::void_ > > > > > > > > > sl@0: >::type type; sl@0: }; sl@0: sl@0: } } // End namespaces iostreams, boost. sl@0: sl@0: #endif // #ifndef BOOST_IOSTREAMS_SELECT_HPP_INCLUDED