7 It is very common to return references to arguments or the this-pointer to
8 allow for chaining in C++.
23 When luabind generates code for this, it will create a new object for the
24 return-value, pointing to the self-object. This isn't a problem, but could be a
25 bit inefficient. When using the return_reference_to-policy we have the ability
26 to tell luabind that the return-value is already on the lua stack.
33 #include <luabind/return_reference_to_policy.hpp>
40 return_reference_to(index)
45 ========= =============================================================
47 ========= =============================================================
48 ``index`` The argument index to return a reference to, any argument but
50 ========= =============================================================
72 .def("set", &A::set, **return_reference_to(_1)**)
76 This policy ignores all type information and should be used only it
77 situations where the parameter type is a perfect match to the
78 return-type (such as in the example).