diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-03-06 22:56:56 +0100 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-03-06 22:56:56 +0100 |
commit | f0cccbe3285c039553e1fd8b5a5c7830d6087974 (patch) | |
tree | 57a0902484ec5c8ba3b9a8e7089ed42f58b6a580 /asl/base/functional.hpp | |
parent | 54affafd86e2b7f387345c08e8c7285c775d75e5 (diff) |
Replace ASL_MOVE, ASL_FWD, and ASL_FWD_LIKE by their std:: equivalent
This is because some compiler stuff and diagnostics tools rely on those
symboles being what they are.
Diffstat (limited to 'asl/base/functional.hpp')
-rw-r--r-- | asl/base/functional.hpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/asl/base/functional.hpp b/asl/base/functional.hpp index 9aeb485..509a2b2 100644 --- a/asl/base/functional.hpp +++ b/asl/base/functional.hpp @@ -11,22 +11,22 @@ namespace asl { template<typename... Args, typename C> constexpr auto invoke(is_func auto C::* f, auto&& self, Args&&... args) - -> decltype((self.*f)(ASL_FWD(args)...)) + -> decltype((self.*f)(std::forward<Args>(args)...)) requires requires { - (self.*f)(ASL_FWD(args)...); + (self.*f)(std::forward<Args>(args)...); } { - return (ASL_FWD(self).*f)(ASL_FWD(args)...); + return (std::forward<decltype(self)>(self).*f)(std::forward<Args>(args)...); } template<typename... Args, typename C> constexpr auto invoke(is_func auto C::* f, auto* self, Args&&... args) - -> decltype((self->*f)(ASL_FWD(args)...)) + -> decltype((self->*f)(std::forward<Args>(args)...)) requires requires { - (self->*f)(ASL_FWD(args)...); + (self->*f)(std::forward<Args>(args)...); } { - return (self->*f)(ASL_FWD(args)...); + return (self->*f)(std::forward<Args>(args)...); } template<typename... Args, typename C> @@ -37,7 +37,7 @@ constexpr auto invoke(is_object auto C::* m, auto&& self, Args&&...) requires { self.*m; } ) { - return ASL_FWD(self).*m; + return std::forward<decltype(self)>(self).*m; } template<typename... Args, typename C> @@ -53,12 +53,12 @@ constexpr auto invoke(is_object auto C::* m, auto* self, Args&&...) template<typename... Args> constexpr auto invoke(auto&& f, Args&&... args) - -> decltype(f(ASL_FWD(args)...)) + -> decltype(f(std::forward<Args>(args)...)) requires requires { - f(ASL_FWD(args)...); + f(std::forward<Args>(args)...); } { - return ASL_FWD(f)(ASL_FWD(args)...); + return std::forward<decltype(f)>(f)(std::forward<Args>(args)...); } template<typename Void, typename F, typename... Args> @@ -76,7 +76,7 @@ using invoke_result_t = _invoke_result_helper<void, F, Args...>::type; template<typename F, typename... Args> concept invocable = requires (F&& f, Args&&... args) { - invoke(ASL_FWD(f), ASL_FWD(args)...); + invoke(std::forward<F>(f), std::forward<Args>(args)...); }; } // namespace asl |