summaryrefslogtreecommitdiff
path: root/c10
diff options
context:
space:
mode:
authorSebastian Messmer <messmer@fb.com>2019-03-21 14:51:38 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2019-03-21 14:57:33 -0700
commit104773c715acd79909bd7ef90376c61c25839793 (patch)
tree4ff5a5709e9763cfdca92866685af99c24ef55d8 /c10
parent8b94de06afefbf81029e04ef23c189687bb7103b (diff)
downloadpytorch-104773c715acd79909bd7ef90376c61c25839793.tar.gz
pytorch-104773c715acd79909bd7ef90376c61c25839793.tar.bz2
pytorch-104773c715acd79909bd7ef90376c61c25839793.zip
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
Diffstat (limited to 'c10')
-rw-r--r--c10/util/C++17.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/c10/util/C++17.h b/c10/util/C++17.h
index 8dd61b9fb2..af5bf1005b 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 <class F, class Tuple, std::size_t... I>
-constexpr auto apply_impl(F&& f, Tuple&& t, guts::index_sequence<I...>) -> decltype(forward<F>(f)(std::get<I>(forward<Tuple>(t))...))
+constexpr auto apply_impl(F&& f, Tuple&& t, guts::index_sequence<I...>) -> decltype(c10::guts::forward<F>(f)(std::get<I>(c10::guts::forward<Tuple>(t))...))
{
- return forward<F>(f)(std::get<I>(forward<Tuple>(t))...);
+ return c10::guts::forward<F>(f)(std::get<I>(c10::guts::forward<Tuple>(t))...);
}
} // namespace detail
template <class F, class Tuple>
constexpr auto apply(F&& f, Tuple&& t) -> decltype(detail::apply_impl(
- forward<F>(f), forward<Tuple>(t),
+ c10::guts::forward<F>(f), c10::guts::forward<Tuple>(t),
guts::make_index_sequence<std::tuple_size<guts::remove_reference_t<Tuple>>::value>{}))
{
return detail::apply_impl(
- forward<F>(f), forward<Tuple>(t),
+ c10::guts::forward<F>(f), c10::guts::forward<Tuple>(t),
guts::make_index_sequence<std::tuple_size<guts::remove_reference_t<Tuple>>::value>{});
}