compile.hana.tuple.erb.cpp 598 B

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