mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-29 08:32:02 +00:00
minor cleanups
This commit is contained in:
parent
0871228f42
commit
7d0162a2df
@ -137,19 +137,24 @@ enum class return_value_policy : int {
|
|||||||
/** Automatic: copy objects returned as values and take ownership of objects
|
/** Automatic: copy objects returned as values and take ownership of objects
|
||||||
returned as pointers */
|
returned as pointers */
|
||||||
automatic = 0,
|
automatic = 0,
|
||||||
|
|
||||||
/** Automatic variant 2: copy objects returned as values and reference objects
|
/** Automatic variant 2: copy objects returned as values and reference objects
|
||||||
returned as pointers */
|
returned as pointers */
|
||||||
automatic_reference,
|
automatic_reference,
|
||||||
|
|
||||||
/** Reference the object and take ownership. Python will call the
|
/** Reference the object and take ownership. Python will call the
|
||||||
destructor and delete operator when the reference count reaches zero */
|
destructor and delete operator when the reference count reaches zero */
|
||||||
take_ownership,
|
take_ownership,
|
||||||
|
|
||||||
/** Reference the object, but do not take ownership (dangerous when C++ code
|
/** Reference the object, but do not take ownership (dangerous when C++ code
|
||||||
deletes it and Python still has a nonzero reference count) */
|
deletes it and Python still has a nonzero reference count) */
|
||||||
reference,
|
reference,
|
||||||
|
|
||||||
/** Reference the object, but do not take ownership. The object is considered
|
/** Reference the object, but do not take ownership. The object is considered
|
||||||
be owned by the C++ instance whose method or property returned it. The
|
be owned by the C++ instance whose method or property returned it. The
|
||||||
Python object will increase the reference count of this 'parent' by 1 */
|
Python object will increase the reference count of this 'parent' by 1 */
|
||||||
reference_internal,
|
reference_internal,
|
||||||
|
|
||||||
/// Create a new copy of the returned object, which will be owned by Python
|
/// Create a new copy of the returned object, which will be owned by Python
|
||||||
copy
|
copy
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user