Sophie

Sophie

distrib > Fedora > 13 > x86_64 > media > updates > by-pkgid > 2cb8864ce5795b07e9b4918eb1189588 > files > 85

luabind-devel-0.9.1-1.fc13.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)**)
    ];