Skip to content

Commit 424ac4f

Browse files
authored
fix: Windows compiler, missing object initializer (#4188)
* Fix for windows compiler, missing object initializer * Removal of if-else macro for MSVC
1 parent d02f219 commit 424ac4f

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

include/pybind11/detail/common.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -1033,12 +1033,7 @@ PYBIND11_NAMESPACE_END(detail)
10331033
/// - regular: static_cast<Return (Class::*)(Arg0, Arg1, Arg2)>(&Class::func)
10341034
/// - sweet: overload_cast<Arg0, Arg1, Arg2>(&Class::func)
10351035
template <typename... Args>
1036-
# if (defined(_MSC_VER) && _MSC_VER < 1920) /* MSVC 2017 */ \
1037-
|| (defined(__clang__) && __clang_major__ == 5)
1038-
static constexpr detail::overload_cast_impl<Args...> overload_cast = {};
1039-
# else
1040-
static constexpr detail::overload_cast_impl<Args...> overload_cast;
1041-
# endif
1036+
static constexpr detail::overload_cast_impl<Args...> overload_cast{};
10421037
#endif
10431038

10441039
/// Const member function selector for overload_cast

0 commit comments

Comments
 (0)