From 424ac4fe1bde46894a56775e78a702199a03137b Mon Sep 17 00:00:00 2001 From: Jan Iwaszkiewicz Date: Tue, 20 Sep 2022 19:03:57 +0200 Subject: [PATCH] fix: Windows compiler, missing object initializer (#4188) * Fix for windows compiler, missing object initializer * Removal of if-else macro for MSVC --- include/pybind11/detail/common.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 9e6947daa..6da7ef859 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -1033,12 +1033,7 @@ PYBIND11_NAMESPACE_END(detail) /// - regular: static_cast(&Class::func) /// - sweet: overload_cast(&Class::func) template -# if (defined(_MSC_VER) && _MSC_VER < 1920) /* MSVC 2017 */ \ - || (defined(__clang__) && __clang_major__ == 5) -static constexpr detail::overload_cast_impl overload_cast = {}; -# else -static constexpr detail::overload_cast_impl overload_cast; -# endif +static constexpr detail::overload_cast_impl overload_cast{}; #endif /// Const member function selector for overload_cast