| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- adopt
- ----------------
- Motivation
- ~~~~~~~~~~
- Used to transfer ownership across language boundaries.
- Defined in
- ~~~~~~~~~~
- .. parsed-literal::
- #include <luabind/adopt_policy.hpp>
- Synopsis
- ~~~~~~~~
- .. parsed-literal::
- adopt(index)
- Parameters
- ~~~~~~~~~~
- ============= ===============================================================
- Parameter Purpose
- ============= ===============================================================
- ``index`` The index which should transfer ownership, ``_N`` or ``result``
- ============= ===============================================================
- Example
- ~~~~~~~
- .. parsed-literal::
- X* create()
- {
- return new X;
- }
- ...
- module(L)
- [
- def("create", &create, **adopt(result)**)
- ];
|