11template <
typename L,
typename R,
bool = L::value>
13 static constexpr bool value =
false;
16template <
typename L,
typename R>
18 static constexpr bool value = R::value;
23 static constexpr bool value =
true;
26template <
typename L,
typename R,
bool = L::value>
28 static constexpr bool value =
true;
31template <
typename L,
typename R>
33 static constexpr bool value = R::value;
38 static constexpr bool value =
false;
52template <
typename... Elements>
57 static constexpr bool value =
false;
60template <
typename... Ts>
62 static constexpr bool value =
true;
65template <
typename T>
using enable_list =
typename std::enable_if<is_list_t<T>::value>::type;
66template <
typename T>
using disable_list =
typename std::enable_if<!is_list_t<T>::value>::type;
69template <
typename... Elements>
71 template <
typename L>
using append_ravel =
typename L::template
prepend<Elements...>;
72 template <
typename L>
using prepend_ravel =
typename L::template
append<Elements...>;
74 template <
typename... Es>
using append =
List<Elements..., Es...>;
75 template <
typename... Es>
using prepend =
List<Es..., Elements...>;
78template <
typename... Elements>
89 template <
typename Functor,
typename... Args>
90 static inline void apply(Functor && functor, Args&&... args) {}
97 template <
template <
typename>
class Functor>
105 template <
template <
typename,
typename>
class Reducer>
113 template <
template <
typename>
class Functor>
121 template <
template <
typename>
class Predicate>
132 template <
size_t position>
137 template <
size_t position,
typename Element,
typename... Elements>
139 using type =
typename List<Elements...>::template at<position-1>;
142 template <
typename Element,
typename... Elements>
144 using type = Element;
147 template <
template <
typename>
class Predicate, bool,
typename Element,
typename... Elements>
149 using list =
typename List<Elements...>::template filter<Predicate>;
152 template <
template <
typename>
class Predicate,
typename Element,
typename... Elements>
154 using list =
typename List<Elements...>::template filter<Predicate>::template prepend<Element>;
158template <
typename Element,
typename... Elements>
160 template <
typename Functor,
typename... Args>
161 static inline void apply(Functor && functor, Args&&... args) {
162 functor.template operator()<Element>(std::forward<Args>(args)...);
163 List<Elements...>::template apply<Functor>(std::forward<Functor>(functor), std::forward<Args>(args)...);
166 template <
template <
typename>
class Functor>
169 template <
template <
typename,
typename>
class Reducer>
170 using reduce_t = Reducer< Element,
typename List<Elements...>::template reduce_t<Reducer> >;
172 template <
template <
typename>
class Functor>
173 using map_ravel_t =
typename List<Elements...>::template map_ravel_t<Functor>::template prepend_ravel<typename Functor<Element>::list>;
175 template <
template <
typename>
class Predicate>
180 template <
size_t position>
192template <
template<
typename>
class Predicate,
template<
typename>
class Extract,
template<
typename>
class Children>
200 template <
typename RootTag>
205 using tail =
typename Children<RootTag>::list::template map_ravel_t<preorder_depthfirst_t>;
207 using list =
typename head::template append_ravel<tail>;
213 template<
typename... Ts>
struct make_void {
typedef void type;};
214 template<
typename... Ts>
using void_t =
typename make_void<Ts...>::type;
216 template <
typename T,
typename =
void>
219 template <
typename T>
221 decltype(std::begin(std::declval<T>())),
222 decltype(std::end(std::declval<T>()))
223 > > : std::true_type {};
231namespace mp = metaprog;