diff --git a/headers/kari.hpp/kari.hpp b/headers/kari.hpp/kari.hpp index 55805da..fc7da9f 100644 --- a/headers/kari.hpp/kari.hpp +++ b/headers/kari.hpp/kari.hpp @@ -42,7 +42,7 @@ namespace kari_hpp::detail if constexpr ( std::is_invocable_v, Args...> ) { return std::apply(std::forward(f), std::move(args)); } else { - return curry_t, Args...>(std::forward(f), std::move(args)); + return curry_t(std::forward(f), std::move(args)); } } } @@ -51,19 +51,14 @@ namespace kari_hpp { template < typename F, typename... Args > class curry_t final { - constexpr curry_t(F f, std::tuple args) - : f_(std::move(f)) - , args_(std::move(args)) {} - - template < typename U, typename... As > - friend class curry_t; - - template < typename U, typename... As > - friend constexpr auto detail::curry_or_apply(U&&, std::tuple&&); public: constexpr curry_t(F f) : f_(std::move(f)) {} + constexpr curry_t(F f, std::tuple args) + : f_(std::move(f)) + , args_(std::move(args)) {} + constexpr auto operator()() && { return detail::curry_or_apply( std::move(f_),