fix: Windows compiler, missing object initializer (#4188)

* Fix for windows compiler, missing object initializer

* Removal of if-else macro for MSVC
This commit is contained in:
Jan Iwaszkiewicz 2022-09-20 19:03:57 +02:00 committed by GitHub
parent d02f219fb9
commit 424ac4fe1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1033,12 +1033,7 @@ PYBIND11_NAMESPACE_END(detail)
/// - regular: static_cast<Return (Class::*)(Arg0, Arg1, Arg2)>(&Class::func) /// - regular: static_cast<Return (Class::*)(Arg0, Arg1, Arg2)>(&Class::func)
/// - sweet: overload_cast<Arg0, Arg1, Arg2>(&Class::func) /// - sweet: overload_cast<Arg0, Arg1, Arg2>(&Class::func)
template <typename... Args> template <typename... Args>
# if (defined(_MSC_VER) && _MSC_VER < 1920) /* MSVC 2017 */ \ static constexpr detail::overload_cast_impl<Args...> overload_cast{};
|| (defined(__clang__) && __clang_major__ == 5)
static constexpr detail::overload_cast_impl<Args...> overload_cast = {};
# else
static constexpr detail::overload_cast_impl<Args...> overload_cast;
# endif
#endif #endif
/// Const member function selector for overload_cast /// Const member function selector for overload_cast