yield.rst 441 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. yield
  2. ----------------
  3. Motivation
  4. ~~~~~~~~~~
  5. Makes a C++ function yield when returning.
  6. Defined in
  7. ~~~~~~~~~~
  8. .. parsed-literal::
  9. #include <luabind/yield_policy.hpp>
  10. Synopsis
  11. ~~~~~~~~
  12. .. parsed-literal::
  13. yield
  14. Example
  15. ~~~~~~~
  16. .. parsed-literal::
  17. void do_thing_that_takes_time()
  18. {
  19. ...
  20. }
  21. ...
  22. module(L)
  23. [
  24. def("do_thing_that_takes_time", &do_thing_that_takes_time, **yield**)
  25. ];