github_260.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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/functional/curry.hpp>
  5. #include <boost/hana/functional/partial.hpp>
  6. #include <boost/hana/functional/reverse_partial.hpp>
  7. #include <boost/hana/tuple.hpp>
  8. #include <tuple>
  9. #include <type_traits>
  10. namespace hana = boost::hana;
  11. struct DefaultConstructible {
  12. DefaultConstructible() = default;
  13. };
  14. int main() {
  15. auto curry_tuple = hana::make_tuple(
  16. std::make_tuple(hana::curry<2>(DefaultConstructible{})(DefaultConstructible{}))
  17. );
  18. auto partial_tuple = hana::make_tuple(
  19. std::make_tuple(hana::partial(DefaultConstructible{}, DefaultConstructible{}))
  20. );
  21. auto reverse_partial_tuple = hana::make_tuple(
  22. std::make_tuple(hana::reverse_partial(DefaultConstructible{}, DefaultConstructible{}))
  23. );
  24. static_assert(std::is_default_constructible<decltype(curry_tuple)>::value, "");
  25. static_assert(std::is_default_constructible<decltype(partial_tuple)>::value, "");
  26. static_assert(std::is_default_constructible<decltype(reverse_partial_tuple)>::value, "");
  27. }