2011-05-25から1日間の記事一覧

mpl::switch_ で、タグディスパッチ

んーこれであってるのかな? 何気にタグディスパッチは初めて使ったかも知れない。 mpl::switch_ と組み合わせてみました。 #include <boost/mpl/has_xxx.hpp> #include <boost/mpl/switch.hpp> #include <boost/mpl/always.hpp> #include <boost/mpl/vector.hpp> namespace mpl = boost::mpl; template<typename Vec, int N> struct at_c_impl{ BOOST_MPL_HAS_XXX_TRAIT_DEF(</typename></boost/mpl/vector.hpp></boost/mpl/always.hpp></boost/mpl/switch.hpp></boost/mpl/has_xxx.hpp>…