compile.hana.tuple.erb.cpp 649 B

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