mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Prevent VS from emitting ambiguous symbol errors (third time) (#53490)
Summary: Fixes: https://github.com/pytorch/pytorch/issues/53409 First: https://github.com/pytorch/pytorch/issues/15697 Second: https://github.com/pytorch/pytorch/issues/17863 Pull Request resolved: https://github.com/pytorch/pytorch/pull/53490 Reviewed By: VitalyFedyunin Differential Revision: D26946687 Pulled By: mrshenli fbshipit-source-id: 27f85abecbb75456354cc0373529c8cadc8133bd
This commit is contained in:
committed by
Facebook GitHub Bot
parent
8016d28c0b
commit
cdac61ecd4
@ -275,21 +275,21 @@ decltype(auto) if_constexpr(ThenCallback&& thenCallback, ElseCallback&& elseCall
|
||||
// This will give us better error messages.
|
||||
if constexpr(Condition) {
|
||||
if constexpr (detail::function_takes_identity_argument<ThenCallback>::value) {
|
||||
return std::forward<ThenCallback>(thenCallback)(detail::_identity());
|
||||
return ::std::forward<ThenCallback>(thenCallback)(detail::_identity());
|
||||
} else {
|
||||
return std::forward<ThenCallback>(thenCallback)();
|
||||
return ::std::forward<ThenCallback>(thenCallback)();
|
||||
}
|
||||
} else {
|
||||
if constexpr (detail::function_takes_identity_argument<ElseCallback>::value) {
|
||||
return std::forward<ElseCallback>(elseCallback)(detail::_identity());
|
||||
return ::std::forward<ElseCallback>(elseCallback)(detail::_identity());
|
||||
} else {
|
||||
return std::forward<ElseCallback>(elseCallback)();
|
||||
return ::std::forward<ElseCallback>(elseCallback)();
|
||||
}
|
||||
}
|
||||
#else
|
||||
// C++14 implementation of if constexpr
|
||||
return detail::_if_constexpr<Condition>::call(std::forward<ThenCallback>(thenCallback),
|
||||
std::forward<ElseCallback>(elseCallback));
|
||||
return detail::_if_constexpr<Condition>::call(::std::forward<ThenCallback>(thenCallback),
|
||||
::std::forward<ElseCallback>(elseCallback));
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -300,14 +300,14 @@ decltype(auto) if_constexpr(ThenCallback&& thenCallback) {
|
||||
// This will give us better error messages.
|
||||
if constexpr(Condition) {
|
||||
if constexpr (detail::function_takes_identity_argument<ThenCallback>::value) {
|
||||
return std::forward<ThenCallback>(thenCallback)(detail::_identity());
|
||||
return ::std::forward<ThenCallback>(thenCallback)(detail::_identity());
|
||||
} else {
|
||||
return std::forward<ThenCallback>(thenCallback)();
|
||||
return ::std::forward<ThenCallback>(thenCallback)();
|
||||
}
|
||||
}
|
||||
#else
|
||||
// C++14 implementation of if constexpr
|
||||
return if_constexpr<Condition>(std::forward<ThenCallback>(thenCallback), [] (auto) {});
|
||||
return if_constexpr<Condition>(::std::forward<ThenCallback>(thenCallback), [] (auto) {});
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user