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 <% if input_size > 10 %> 6 #define FUSION_MAX_VECTOR_SIZE <%= ((input_size + 9) / 10) * 10 %> 7 <% end %> 8 9 #include <boost/fusion/include/fold.hpp> 10 #include <boost/fusion/include/make_vector.hpp> 11 namespace fusion = boost::fusion; 12 13 14 struct f { 15 template <typename State, typename X> 16 constexpr X operator()(State, X x) const { return x; } 17 }; 18 19 struct state { }; 20 21 template <int i> 22 struct x { }; 23 24 int main() { 25 auto xs = fusion::make_vector( 26 <%= (1..input_size).map { |n| "x<#{n}>{}" }.join(', ') %> 27 ); 28 29 auto result = fusion::fold(xs, state{}, f{}); 30 (void)result; 31 } 32