// Copyright Louis Dionne 2013-2017 // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) #include template struct list { }; template struct basic_type { using type = T; }; template constexpr basic_type type{}; template constexpr auto foldl(F f, State s, list xs) { return boost::hana::detail::variadic::foldl(f, s, type...); } ////////////////////////////////////////////////////////////////////////////// struct f { template struct result { }; template constexpr auto operator()(X, Y) const { return result{}; } }; template struct x { }; struct state { }; int main() { constexpr auto xs = list< <%= (1..input_size).map { |i| "x<#{i}>" }.join(', ') %> >{}; constexpr auto result = foldl(f{}, state{}, xs); (void)result; }