raw.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. raw
  2. ---
  3. .. note::
  4. ``raw()`` has been deprecated. ``lua_State*`` parameters are
  5. automatically handled by luabind.
  6. Motivation
  7. ~~~~~~~~~~
  8. This converter policy will pass through the ``lua_State*`` unmodified.
  9. This can be useful for example when binding functions that need to
  10. return a ``luabind::object``. The parameter will be removed from the
  11. function signature, decreasing the function arity by one.
  12. Defined in
  13. ~~~~~~~~~~
  14. .. parsed-literal::
  15. #include <luabind/raw_policy.hpp>
  16. Synopsis
  17. ~~~~~~~~
  18. .. parsed-literal::
  19. raw(index)
  20. Parameters
  21. ~~~~~~~~~~
  22. ============= ===============================================================
  23. Parameter Purpose
  24. ============= ===============================================================
  25. ``index`` The index of the lua_State* parameter.
  26. ============= ===============================================================
  27. Example
  28. ~~~~~~~
  29. .. parsed-literal::
  30. void greet(lua_State* L)
  31. {
  32. lua_pushstring(L, "hello");
  33. }
  34. ...
  35. module(L)
  36. [
  37. def("greet", &greet, **raw(_1)**)
  38. ];
  39. > print(greet())
  40. hello