1 // Copyright Louis Dionne 2013-2017
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
5 #include <boost/hana/detail/variadic/foldl1.hpp>
8 template <typename ...xs>
12 struct basic_type { using type = T; };
15 constexpr basic_type<T> type{};
18 template <typename F, typename State, typename ...Xs>
19 constexpr auto foldl(F f, State s, list<Xs...> xs)
20 { return boost::hana::detail::variadic::foldl(f, s, type<Xs>...); }
22 //////////////////////////////////////////////////////////////////////////////
25 template <typename ...>
28 template <typename X, typename Y>
29 constexpr auto operator()(X, Y) const
30 { return result<X, Y>{}; }
33 template <int> struct x { };
37 constexpr auto xs = list<
38 <%= (1..input_size).map { |i| "x<#{i}>" }.join(', ') %>
41 constexpr auto result = foldl(f{}, state{}, xs);