Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > b77c1f3fddbe1ceb74d5aa1e2502ab9c > files > 85

luabind-devel-0.9.1-1.fc14.x86_64.rpm

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)**)
    ];