File indexing completed on 2025-01-18 09:41:57
0001
0002 #ifndef BOOST_MPL_SWITCH_HPP_INCLUDED
0003 #define BOOST_MPL_SWITCH_HPP_INCLUDED
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #include <boost/mpl/find_if.hpp>
0018 #include <boost/mpl/deref.hpp>
0019 #include <boost/mpl/lambda.hpp>
0020 #include <boost/mpl/apply.hpp>
0021 #include <boost/mpl/pair.hpp>
0022 #include <boost/mpl/aux_/na_spec.hpp>
0023 #include <boost/mpl/aux_/lambda_support.hpp>
0024
0025 namespace boost { namespace mpl {
0026
0027 template<
0028 typename BOOST_MPL_AUX_NA_PARAM(Body)
0029 , typename BOOST_MPL_AUX_NA_PARAM(T)
0030 >
0031 struct switch_
0032 {
0033 typedef typename find_if<
0034 Body
0035 , apply1< lambda< first<_1> >, T >
0036 >::type iter_;
0037
0038 typedef typename deref<iter_>::type pair_;
0039 typedef typename lambda< typename second<pair_>::type >::type f_;
0040 typedef typename apply1<f_,T>::type type;
0041
0042 BOOST_MPL_AUX_LAMBDA_SUPPORT(2,switch_,(Body,T))
0043 };
0044
0045 BOOST_MPL_AUX_NA_SPEC(2, switch_)
0046
0047 }}
0048
0049 #endif