From 1a2e8a662456b978e596fd19b6df271d36eafa38 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 14 Nov 2023 23:35:28 -0800 Subject: [PATCH] C++11 compatibility. --- tests/test_cases_for_stubgen.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_cases_for_stubgen.cpp b/tests/test_cases_for_stubgen.cpp index 7b55ce699..6e8128648 100644 --- a/tests/test_cases_for_stubgen.cpp +++ b/tests/test_cases_for_stubgen.cpp @@ -83,6 +83,7 @@ void bind_basics(py::module &basics) { pyPoint.def(py::init<>()) .def(py::init(), py::arg("x"), py::arg("y")) +#ifdef PYBIND11_CPP14 .def("distance_to", py::overload_cast(&Point::distance_to, py::const_), py::arg("x"), @@ -90,6 +91,15 @@ void bind_basics(py::module &basics) { .def("distance_to", py::overload_cast(&Point::distance_to, py::const_), py::arg("other")) +#else + .def("distance_to", + static_cast(&Point::distance_to), + py::arg("x"), + py::arg("y")) + .def("distance_to", + static_cast(&Point::distance_to), + py::arg("other")) +#endif .def_readwrite("x", &Point::x) .def_property( "y",