mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 06:35:12 +00:00
a few more documentation improvements
This commit is contained in:
parent
44db04f580
commit
61d67f0462
@ -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.
|
||||
For this reason, pybind11 provides a several `return value policy` annotations
|
||||
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>);
|
||||
|
||||
.. 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::
|
||||
|
||||
The file :file:`example/example8.cpp` contains a complete example that
|
||||
|
Loading…
Reference in New Issue
Block a user