discard_result.rst 617 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. discard_result
  2. ----------------
  3. Motivation
  4. ~~~~~~~~~~
  5. This is a very simple policy which makes it possible to throw away
  6. the value returned by a C++ function, instead of converting it to
  7. Lua.
  8. Defined in
  9. ~~~~~~~~~~
  10. .. parsed-literal::
  11. #include <luabind/discard_result_policy.hpp>
  12. Synopsis
  13. ~~~~~~~~
  14. .. parsed-literal::
  15. discard_result
  16. Example
  17. ~~~~~~~
  18. .. parsed-literal::
  19. struct X
  20. {
  21. X& set(T n)
  22. {
  23. ...
  24. return \*this;
  25. }
  26. };
  27. ...
  28. module(L)
  29. [
  30. class_<X>("X")
  31. .def("set", &simple::set, **discard_result**)
  32. ];