Fixed for VC6.5.
[luabind.git] / doc / pure_out_value.rst
blobf2dd9d4f6dc0da2fcc9d4420a09142bfc3ada369
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.
11 Defined in
12 ~~~~~~~~~~
14 .. parsed-literal::
16     #include <luabind/out_value_policy.hpp>
18 Synopsis
19 ~~~~~~~~
21 .. parsed-literal::
23     pure_out_value(index, policies = none)
26 Parameters
27 ~~~~~~~~~~
29 =============== =============================================================
30 Parameter       Purpose
31 =============== =============================================================
32 ``index``       The index of the parameter to be used as an out parameter.
33 ``policies``    The policies used internally to convert the out parameter
34                 to Lua. ``_1`` is used as the internal index.
35 =============== =============================================================
37 Example
38 ~~~~~~~
40 .. parsed-literal::
42     void f1(float& val) { val = 10.f; }
43     void f2(float\* val) { \*val = 10.f; }
45     module(L)
46     [
47         def("f", &f, **pure_out_value(_1)**)
48     ];
50     Lua 5.0  Copyright (C) 1994-2003 Tecgraf, PUC-Rio
51     > print(f1())
52     10
53     > print(f2())
54     10