diff options
Diffstat (limited to 'absl/functional')
-rw-r--r-- | absl/functional/bind_front.h | 5 | ||||
-rw-r--r-- | absl/functional/internal/front_binder.h | 18 |
2 files changed, 12 insertions, 11 deletions
diff --git a/absl/functional/bind_front.h b/absl/functional/bind_front.h index a956eb02..885f24b8 100644 --- a/absl/functional/bind_front.h +++ b/absl/functional/bind_front.h @@ -34,6 +34,8 @@ #include <functional> // For std::bind_front. #endif // defined(__cpp_lib_bind_front) && __cpp_lib_bind_front >= 201907L +#include <utility> + #include "absl/functional/internal/front_binder.h" #include "absl/utility/utility.h" @@ -182,8 +184,7 @@ template <class F, class... BoundArgs> constexpr functional_internal::bind_front_t<F, BoundArgs...> bind_front( F&& func, BoundArgs&&... args) { return functional_internal::bind_front_t<F, BoundArgs...>( - absl::in_place, absl::forward<F>(func), - absl::forward<BoundArgs>(args)...); + absl::in_place, std::forward<F>(func), std::forward<BoundArgs>(args)...); } #endif // defined(__cpp_lib_bind_front) && __cpp_lib_bind_front >= 201907L diff --git a/absl/functional/internal/front_binder.h b/absl/functional/internal/front_binder.h index 45f52de7..44a54928 100644 --- a/absl/functional/internal/front_binder.h +++ b/absl/functional/internal/front_binder.h @@ -34,8 +34,8 @@ namespace functional_internal { template <class R, class Tuple, size_t... Idx, class... Args> R Apply(Tuple&& bound, absl::index_sequence<Idx...>, Args&&... free) { return base_internal::invoke( - absl::forward<Tuple>(bound).template get<Idx>()..., - absl::forward<Args>(free)...); + std::forward<Tuple>(bound).template get<Idx>()..., + std::forward<Args>(free)...); } template <class F, class... BoundArgs> @@ -48,13 +48,13 @@ class FrontBinder { public: template <class... Ts> constexpr explicit FrontBinder(absl::in_place_t, Ts&&... ts) - : bound_args_(absl::forward<Ts>(ts)...) {} + : bound_args_(std::forward<Ts>(ts)...) {} template <class... FreeArgs, class R = base_internal::invoke_result_t< F&, BoundArgs&..., FreeArgs&&...>> R operator()(FreeArgs&&... free_args) & { return functional_internal::Apply<R>(bound_args_, Idx(), - absl::forward<FreeArgs>(free_args)...); + std::forward<FreeArgs>(free_args)...); } template <class... FreeArgs, @@ -62,7 +62,7 @@ class FrontBinder { const F&, const BoundArgs&..., FreeArgs&&...>> R operator()(FreeArgs&&... free_args) const& { return functional_internal::Apply<R>(bound_args_, Idx(), - absl::forward<FreeArgs>(free_args)...); + std::forward<FreeArgs>(free_args)...); } template <class... FreeArgs, class R = base_internal::invoke_result_t< @@ -70,8 +70,8 @@ class FrontBinder { R operator()(FreeArgs&&... free_args) && { // This overload is called when *this is an rvalue. If some of the bound // arguments are stored by value or rvalue reference, we move them. - return functional_internal::Apply<R>(absl::move(bound_args_), Idx(), - absl::forward<FreeArgs>(free_args)...); + return functional_internal::Apply<R>(std::move(bound_args_), Idx(), + std::forward<FreeArgs>(free_args)...); } template <class... FreeArgs, @@ -80,8 +80,8 @@ class FrontBinder { R operator()(FreeArgs&&... free_args) const&& { // This overload is called when *this is an rvalue. If some of the bound // arguments are stored by value or rvalue reference, we move them. - return functional_internal::Apply<R>(absl::move(bound_args_), Idx(), - absl::forward<FreeArgs>(free_args)...); + return functional_internal::Apply<R>(std::move(bound_args_), Idx(), + std::forward<FreeArgs>(free_args)...); } }; |