Avoid C-style casts for pointers in docs (#2487)
Why only for pointers? Because C casts are hard to grep for.
diff --git a/docs/classes.rst b/docs/classes.rst
index 1d44a59..f3610ef 100644
--- a/docs/classes.rst
+++ b/docs/classes.rst
@@ -373,8 +373,8 @@
py::class_<Pet>(m, "Pet")
.def(py::init<const std::string &, int>())
- .def("set", (void (Pet::*)(int)) &Pet::set, "Set the pet's age")
- .def("set", (void (Pet::*)(const std::string &)) &Pet::set, "Set the pet's name");
+ .def("set", static_cast<void (Pet::*)(int)>(&Pet::set), "Set the pet's age")
+ .def("set", static_cast<void (Pet::*)(const std::string &)>(&Pet::set), "Set the pet's name");
The overload signatures are also visible in the method's docstring: