a few more documentation improvements

This commit is contained in:
Wenzel Jakob 2015-12-14 12:53:06 +01:00
parent 44db04f580
commit 61d67f0462

View File

@ -393,7 +393,7 @@ information, it is not clear whether Python should take charge of the returned
value and eventually free its resources, or if this is handled on the C++ side. value and eventually free its resources, or if this is handled on the C++ side.
For this reason, pybind11 provides a several `return value policy` annotations For this reason, pybind11 provides a several `return value policy` annotations
that can be passed to the :func:`module::def` and :func:`class_::def` that can be passed to the :func:`module::def` and :func:`class_::def`
functions. The default policy is :enum:`return_value_policy::automatic``. functions. The default policy is :enum:`return_value_policy::automatic`.
+--------------------------------------------------+---------------------------------------------------------------------------+ +--------------------------------------------------+---------------------------------------------------------------------------+
@ -504,6 +504,14 @@ be declared at the top level before any binding code:
PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>); PYBIND11_DECLARE_HOLDER_TYPE(T, std::shared_ptr<T>);
.. warning::
The first argument of :func:`PYBIND11_DECLARE_HOLDER_TYPE` should be a
placeholder name that is used as a template parameter of the second
argument. Thus, feel free to use any identifier, but use it consistently on
both sides; also, don't use the name of a type that already exists in your
codebase.
.. seealso:: .. seealso::
The file :file:`example/example8.cpp` contains a complete example that The file :file:`example/example8.cpp` contains a complete example that