mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
11 lines
445 B
ReStructuredText
11 lines
445 B
ReStructuredText
yielding
|
|
========
|
|
*telling a C++ function to yield its results into Lua*
|
|
|
|
.. code-block:: cpp
|
|
|
|
template <typename F>
|
|
yield_wrapper<F> yielding( F&& f )
|
|
|
|
``sol::yielding`` is useful for calling C++ functions which need to yield into a Lua coroutine. It is a wrapper around a single argument which is expected to be bound as a function. You can pass it anywhere a regular function can be bound, **except for in usertype definitions**.
|