Conversation
Removed mention of C++20 coroutine interop from benchmark suite description.
There was a problem hiding this comment.
Pull request overview
This PR introduces opt-in custom converters that allow LuaBridge3 to convert a registered userdata source type (From) into a C++ target value type (To) while extracting function arguments from the Lua stack (a “Phase 3” fallback after exact match and inheritance).
Changes:
- Adds converter infrastructure (
StackConversion,StackConverter, converter registry storage) and a new.addConverter<To>()registration API. - Updates stack extraction to support Phase-3 conversion for converter-enabled target types (including
const T&call sites). - Adds comprehensive tests, documentation, and benchmark cases (plus benchmark plotting improvements with stddev/error bars).
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Source/ConverterTests.cpp | New unit tests validating converter registration, Phase-3 extraction, multi-source conversion, and inheritance/multiple-inheritance scenarios. |
| Tests/CMakeLists.txt | Adds the new converter test source file to the test target. |
| Source/LuaBridge/LuaBridge.h | Adds a top-level include for the new converter header. |
| Source/LuaBridge/detail/Stack.h | Adjusts Stack specializations to route converter-enabled const T& through the new converter-aware implementation. |
| Source/LuaBridge/detail/Namespace.h | Adds .addConverter<To>() API on Class<T> to register converters into a per-class registry. |
| Source/LuaBridge/detail/Converter.h | New converter system header: opt-in traits, registry, dispatch, and Stack specializations for converter-enabled targets. |
| Source/LuaBridge/detail/ClassInfo.h | Adds a dedicated Lua metatable key for storing the converter registry userdata. |
| README.md | Expands benchmark methodology/coverage description to mention custom type converters. |
| Manual.md | Documents “Custom Type Converters”, adds API reference entries, and updates table of contents links. |
| justfile | Adds convenience build/test recipes. |
| Distribution/LuaBridge/LuaBridge.h | Updates the amalgamated header to include converter support and related includes. |
| Benchmarks/plot_benchmarks.py | Adds stddev support and error bars, improves ordering/styling, switches to pathlib. |
| Benchmarks/benchmark_sol3.cpp | Renames a benchmark function for consistent naming. |
| Benchmarks/benchmark_luabridge3.cpp | Adds converter benchmarks and converter trait specializations for benchmark types. |
| Benchmarks/benchmark_luabridge.cpp | Renames a benchmark function for consistent naming. |
| Benchmarks/benchmark_common.hpp | Adds benchmark types/functions used by the new converter benchmarks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.