Skip to content

Commit 575cdf0

Browse files
committed
Turn documentation comment of module_::add_object into valid doxygen documentation
1 parent 4be6029 commit 575cdf0

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

docs/Doxyfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ QUIET = YES
1919
WARNINGS = YES
2020
WARN_IF_UNDOCUMENTED = NO
2121
PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \
22-
PY_MAJOR_VERSION=3
22+
PY_MAJOR_VERSION=3 \
23+
PYBIND11_NOINLINE

include/pybind11/pybind11.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -944,11 +944,13 @@ class module_ : public object {
944944
*this = reinterpret_steal<module_>(obj);
945945
}
946946

947-
// Adds an object to the module using the given name. Throws if an object with the given name
948-
// already exists.
949-
//
950-
// overwrite should almost always be false: attempting to overwrite objects that pybind11 has
951-
// established will, in most cases, break things.
947+
/** \rst
948+
Adds an object to the module using the given name. Throws if an object with the given name
949+
already exists.
950+
951+
``overwrite`` should almost always be false: attempting to overwrite objects that pybind11 has
952+
established will, in most cases, break things.
953+
\endrst */
952954
PYBIND11_NOINLINE void add_object(const char *name, handle obj, bool overwrite = false) {
953955
if (!overwrite && hasattr(*this, name))
954956
pybind11_fail("Error during initialization: multiple incompatible definitions with name \"" +

0 commit comments

Comments
 (0)