29 #ifndef _util_misc_meta_h
30 #define _util_misc_meta_h
33 #include <boost/mpl/back.hpp>
34 #include <boost/mpl/pop_back.hpp>
35 #include <boost/mpl/empty.hpp>
37 namespace sc {
namespace meta {
39 namespace mpl = boost::mpl;
49 template<
template<
typename...>
class T,
bool empty,
typename C,
typename... Types>
51 typedef typename mpl::pop_back<C>::type rest;
52 typedef typename splat_helper<
53 T, mpl::empty<rest>::value, rest,
typename mpl::back<C>::type, Types...
57 template<
template<
typename...>
class T,
typename C,
typename... Types>
58 struct splat_helper<T, true, C, Types...> {
59 typedef T<Types...> type;
62 template<
typename value_type,
template<value_type...>
class T,
bool empty,
typename C, value_type... values>
63 struct splat_helper_values {
64 typedef typename mpl::pop_back<C>::type rest;
65 typedef typename splat_helper_values<
66 value_type, T, mpl::empty<rest>::value, rest, mpl::back<C>::type::value, values...
70 template<
typename value_type,
template<value_type...>
class T,
typename C, value_type... values>
71 struct splat_helper_values<value_type, T, true, C, values...> {
72 typedef T<values...> type;
77 template<
template<
typename...>
class T,
typename C>
79 : splat_helper<T, mpl::empty<C>::value, C>
83 template<
typename value_type,
template<value_type...>
class T,
typename C>
85 : splat_helper_values<value_type, T, mpl::empty<C>::value, C>