fix: rename `pybind11::module` to `pybind11::module_` (#2489)
Support C++20. For backwards compatibility, we provide an alias for the old name.
This change is necessary to easily avoid errors when a compiler thinks
`module` is used as a keyword.
diff --git a/docs/changelog.rst b/docs/changelog.rst
index e9b42d7..8f95c12 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -11,6 +11,11 @@
See :ref:`upgrade-guide-2.6` for help upgrading to the new version.
+* Provide an additional spelling of ``py::module`` - ``py::module_`` (with a
+ trailing underscore), for C++20 compatibility. Only relevant when used
+ unqualified.
+ `#2489 <https://github.com/pybind/pybind11/pull/2489>`_
+
* ``pybind11_add_module()`` now accepts an optional ``OPT_SIZE`` flag that
switches the binding target to size-based optimization regardless global
CMake build type (except in debug mode, where optimizations remain disabled).
diff --git a/docs/reference.rst b/docs/reference.rst
index 752dfed..e3a61af 100644
--- a/docs/reference.rst
+++ b/docs/reference.rst
@@ -46,7 +46,7 @@
Convenience classes for specific Python types
=============================================
-.. doxygenclass:: module
+.. doxygenclass:: module_
:members:
.. doxygengroup:: pytypes