mirror of
https://github.com/BlackMATov/kari.hpp.git
synced 2026-01-04 17:20:56 +07:00
remove friends using
This commit is contained in:
@@ -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_),
|
||||||
|
|||||||
Reference in New Issue
Block a user