| 1 | // Copyright Louis Dionne 2013-2022 |
|---|---|
| 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/functional/curry.hpp> |
| 6 | #include <boost/hana/functional/partial.hpp> |
| 7 | #include <boost/hana/functional/reverse_partial.hpp> |
| 8 | #include <boost/hana/tuple.hpp> |
| 9 | |
| 10 | #include <tuple> |
| 11 | #include <type_traits> |
| 12 | namespace hana = boost::hana; |
| 13 | |
| 14 | |
| 15 | struct DefaultConstructible { |
| 16 | DefaultConstructible() = default; |
| 17 | }; |
| 18 | |
| 19 | int main() { |
| 20 | auto curry_tuple = hana::make_tuple( |
| 21 | std::make_tuple(args: hana::curry<2>(DefaultConstructible{})(DefaultConstructible{})) |
| 22 | ); |
| 23 | |
| 24 | auto partial_tuple = hana::make_tuple( |
| 25 | std::make_tuple(args: hana::partial(DefaultConstructible{}, DefaultConstructible{})) |
| 26 | ); |
| 27 | |
| 28 | auto reverse_partial_tuple = hana::make_tuple( |
| 29 | std::make_tuple(args: hana::reverse_partial(DefaultConstructible{}, DefaultConstructible{})) |
| 30 | ); |
| 31 | |
| 32 | static_assert(std::is_default_constructible<decltype(curry_tuple)>::value, ""); |
| 33 | static_assert(std::is_default_constructible<decltype(partial_tuple)>::value, ""); |
| 34 | static_assert(std::is_default_constructible<decltype(reverse_partial_tuple)>::value, ""); |
| 35 | } |
| 36 |
