Summary:
Fixes #14663.
Test for CUDA 8 is running here: https://dev.azure.com/pytorch/PyTorch/_build/results?buildId=54
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14665
Differential Revision:
D13290392
Pulled By: soumith
fbshipit-source-id:
57f0d5b704e5d1fcb4927cbc007327b4ed74f443
namespace detail_ {
+// VS 2015 doesn't handle constexpr well, so we need to skip these stuff.
+#if (defined _MSC_VER) && (_MSC_VER <= 1900)
+template <typename T>
+T* static_addressof(T& ref) {
+ return std::addressof(ref);
+}
+#else
// static_addressof: a constexpr version of addressof
template <typename T>
struct has_overloaded_addressof {
T* static_addressof(T& ref) {
return std::addressof(ref);
}
+#endif
// the call to convert<A>(b) has return type A and converts b to type A iff b
// decltype(b) is implicitly convertible to A