Skip to content

C++20 Coroutines support#218

Merged
kunitoki merged 11 commits intomasterfrom
dev/coro
Apr 7, 2026
Merged

C++20 Coroutines support#218
kunitoki merged 11 commits intomasterfrom
dev/coro

Conversation

@kunitoki
Copy link
Copy Markdown
Owner

@kunitoki kunitoki commented Apr 7, 2026

This pull request introduces comprehensive C++20 coroutine support to LuaBridge3, enabling seamless interoperability between C++20 coroutines and Lua coroutines.

C++20 Coroutine Integration

  • Added support for C++20 coroutines via the new CppCoroutine<R> type, allowing C++ generators to be exposed to Lua and used with Lua's coroutine API. Coroutines can be registered in namespaces and classes, including as static or member methods. Awaiting Lua threads from C++ coroutines is supported via the new LuaCoroutine awaitable.
  • Introduced new helpers and error codes for coroutine support: lua_resume_x, lua_isyieldable_x, ErrorCode::CoroutineYieldFromNonCoroutine, and ErrorCode::CoroutineAlreadyDone.
  • Added feature-detection and opt-out macros: LUABRIDGE_HAS_CXX20_COROUTINES (auto-detected), LUABRIDGE_DISABLE_CXX20_COROUTINES (manual override).

@kunitoki kunitoki merged commit b61dcfa into master Apr 7, 2026
45 checks passed
@kunitoki kunitoki deleted the dev/coro branch April 7, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant