remove friends using

This commit is contained in:
BlackMATov
2020-12-11 09:53:08 +07:00
parent 50fd7b7111
commit 54d9db7138

View File

@@ -42,7 +42,7 @@ namespace kari_hpp::detail
if constexpr ( std::is_invocable_v<std::decay_t<F>, Args...> ) { if constexpr ( std::is_invocable_v<std::decay_t<F>, Args...> ) {
return std::apply(std::forward<F>(f), std::move(args)); return std::apply(std::forward<F>(f), std::move(args));
} else { } else {
return curry_t<std::decay_t<F>, Args...>(std::forward<F>(f), std::move(args)); return curry_t(std::forward<F>(f), std::move(args));
} }
} }
} }
@@ -51,19 +51,14 @@ namespace kari_hpp
{ {
template < typename F, typename... Args > template < typename F, typename... Args >
class curry_t final { class curry_t final {
constexpr curry_t(F f, std::tuple<Args...> 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<As...>&&);
public: public:
constexpr curry_t(F f) constexpr curry_t(F f)
: f_(std::move(f)) {} : f_(std::move(f)) {}
constexpr curry_t(F f, std::tuple<Args...> args)
: f_(std::move(f))
, args_(std::move(args)) {}
constexpr auto operator()() && { constexpr auto operator()() && {
return detail::curry_or_apply( return detail::curry_or_apply(
std::move(f_), std::move(f_),