Fixed placeholder compatibility with Boost 1.34.
[luabind.git] / doc / pure_out_value.rst
blob1efc84fe7f9633b768ac859dfcecc9190e177955
1 pure_out_value
2 ----------------
4 Motivation
5 ~~~~~~~~~~
7 This works exactly like ``out_value``, except that it will pass a
8 default constructed object instead of converting an argument from
9 Lua. This means that the parameter will be removed from the lua
10 signature.
12 Defined in
13 ~~~~~~~~~~
15 .. parsed-literal::
17     #include <luabind/out_value_policy.hpp>
19 Synopsis
20 ~~~~~~~~
22 .. parsed-literal::
24     pure_out_value(index, policies = none)
27 Parameters
28 ~~~~~~~~~~
30 =============== =============================================================
31 Parameter       Purpose
32 =============== =============================================================
33 ``index``       The index of the parameter to be used as an out parameter.
34 ``policies``    The policies used internally to convert the out parameter
35                 to Lua. ``_1`` is used as the internal index.
36 =============== =============================================================
38 Example
39 ~~~~~~~
41 Note that no values are passed to the calls to ``f1`` and ``f2``.
43 .. parsed-literal::
45     void f1(float& val) { val = 10.f; }
46     void f2(float\* val) { \*val = 10.f; }
48     module(L)
49     [
50         def("f", &f, **pure_out_value(_1)**)
51     ];
53     Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
54     > print(f1())
55     10
56     > print(f2())
57     10