From 104773c715acd79909bd7ef90376c61c25839793 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Thu, 21 Mar 2019 14:51:38 -0700 Subject: [PATCH] Fix use of c10::guts::apply (#18159) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/18159 In some instances, the call to forward could clash with std::forward. Fully qualify it to make sure it gets the right one Reviewed By: ezyang Differential Revision: D14512189 fbshipit-source-id: 6242607dbe54fcdb93229c1a4aaee8b84a88caa1 --- c10/util/C++17.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/c10/util/C++17.h b/c10/util/C++17.h index 8dd61b9..af5bf10 100644 --- a/c10/util/C++17.h +++ b/c10/util/C++17.h @@ -192,19 +192,19 @@ inline constexpr decltype(auto) apply(F&& f, Tuple&& t) { // TODO This is an incomplete implementation of std::apply, not working for member functions. namespace detail { template -constexpr auto apply_impl(F&& f, Tuple&& t, guts::index_sequence) -> decltype(forward(f)(std::get(forward(t))...)) +constexpr auto apply_impl(F&& f, Tuple&& t, guts::index_sequence) -> decltype(c10::guts::forward(f)(std::get(c10::guts::forward(t))...)) { - return forward(f)(std::get(forward(t))...); + return c10::guts::forward(f)(std::get(c10::guts::forward(t))...); } } // namespace detail template constexpr auto apply(F&& f, Tuple&& t) -> decltype(detail::apply_impl( - forward(f), forward(t), + c10::guts::forward(f), c10::guts::forward(t), guts::make_index_sequence>::value>{})) { return detail::apply_impl( - forward(f), forward(t), + c10::guts::forward(f), c10::guts::forward(t), guts::make_index_sequence>::value>{}); } -- 2.7.4