Skip to content

Commit e1173ab

Browse files
committed
Require deducing this support
1 parent 97ddd4d commit e1173ab

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

libraries/core/lib/morpheus/core/functional/curry.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
namespace morpheus::functional
88
{
99

10+
#if (__cpp_explicit_this_parameter >= 202110L)
11+
1012
/// \fn curry
11-
///
13+
/// Currying is a technique in which we consider a function takign multuiple arguments and turn it into a function which takes a single argument and
14+
/// returns a funtion to handle the remaining arguments.
1215
/// \note
1316
/// [Applicative: The Forgotten Functional Pattern in C++ - Ben Deane - CppNow 2023](https://youtu.be/At-b4PHNxMg?si=hDI3zgmfPwrrIxoe&t=1313)
1417
template <typename F, typename... Args>
@@ -25,4 +28,6 @@ constexpr auto curry(F&& f, Args&&... args) -> decltype(auto)
2528
}
2629
}
2730

31+
#endif // (__cpp_explicit_this_parameter >= 202110L)
32+
2833
} // namespace morpheus::functional

libraries/core/tests/functional/curry.tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
namespace morpheus::functional
66
{
77

8+
#if (__cpp_explicit_this_parameter >= 202110L)
9+
810
TEST_CASE("Verify partial application via currying", "[morpheus.functional.curry]")
911
{
1012
SECTION("Zero parameters")
@@ -52,4 +54,6 @@ TEST_CASE("Verify partial application via currying", "[morpheus.functional.curry
5254
}
5355
}
5456

57+
#endif // (__cpp_explicit_this_parameter >= 202110L)
58+
5559
} // namespace morpheus::functional

0 commit comments

Comments
 (0)