Chris@16: // Copyright 2008-2010 Gordon Woodhull Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_MSM_MPL_GRAPH_MPL_UTILS_HPP_INCLUDED Chris@16: #define BOOST_MSM_MPL_GRAPH_MPL_UTILS_HPP_INCLUDED Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace msm { Chris@16: namespace mpl_graph { Chris@16: namespace mpl_utils { Chris@16: Chris@16: // This is a grab bag of little metafunctions I expect already Chris@16: // exist under some name I haven't looked for Chris@16: Chris@16: // I figure there are probably better ways to do all of these things, Chris@16: // but for now I'll just write some utilities to isolate my ignorance Chris@16: Chris@16: template Chris@16: struct as_map : Chris@16: mpl::fold, Chris@16: mpl::insert > Chris@16: {}; Chris@16: template Chris@16: struct as_set : Chris@16: mpl::fold, Chris@16: mpl::insert > Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct at_or_default : Chris@16: mpl::if_::type, Chris@16: typename mpl::at::type, Chris@16: Default> Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct set_equal : Chris@16: mpl::fold::type, Chris@16: mpl::_2 > > > Chris@16: {}; Chris@16: Chris@16: } Chris@16: } Chris@16: } Chris@16: } Chris@16: Chris@16: #endif // BOOST_MSM_MPL_GRAPH_MPL_UTILS_HPP_INCLUDED