Fixed placeholder compatibility with Boost 1.34.
[luabind.git] / doc / copy.rst
blob8aa882fe040387b65556fc2ede22aa9cf4d502ef
1 copy
2 ----------------
4 Motivation
5 ~~~~~~~~~~
7 This will make a copy of the parameter. This is the default behavior when
8 passing parameters by-value. Note that this can only be used when passing from
9 C++ to Lua. This policy requires that the parameter type has an accessible copy
10 constructor.
12 Defined in
13 ~~~~~~~~~~
15 .. parsed-literal::
17     #include <luabind/copy_policy.hpp>
19 Synopsis
20 ~~~~~~~~
22 .. parsed-literal::
24     copy(index)
26 Parameters
27 ~~~~~~~~~~
29 ============= ===============================================================
30 Parameter     Purpose
31 ============= ===============================================================
32 ``index``     The index to copy. ``result`` when used while wrapping C++
33               functions. ``_N`` when passing arguments to Lua.
34 ============= ===============================================================
36 Example
37 ~~~~~~~
39 .. parsed-literal::
41     X* get()
42     {
43         static X instance;
44         return &instance;
45     }
47     ...
49     module(L)
50     [
51         def("create", &create, **copy(result)**)
52     ];