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) 4 5 #include <boost/hana/fold_left.hpp> 6 #include <boost/hana/basic_tuple.hpp> 7 namespace hana = boost::hana; 8 9 10 struct f { 11 template <typename State, typename X> operator ()f12 constexpr X operator()(State, X x) const { return x; } 13 }; 14 15 struct state { }; 16 17 template <int i> 18 struct x { }; 19 main()20int main() { 21 constexpr auto tuple = hana::make_basic_tuple( 22 <%= (1..input_size).map { |n| "x<#{n}>{}" }.join(', ') %> 23 ); 24 constexpr auto result = hana::fold_left(tuple, state{}, f{}); 25 (void)result; 26 } 27