Skip to content

Windows compilation fixes#254

Merged
kunitoki merged 4 commits into
masterfrom
dev/fix_windows
Jul 15, 2026
Merged

Windows compilation fixes#254
kunitoki merged 4 commits into
masterfrom
dev/fix_windows

Conversation

@kunitoki

@kunitoki kunitoki commented Jul 15, 2026

Copy link
Copy Markdown
Owner

This pull request refactors and improves the handling of C++23 flat containers (std::flat_map and std::flat_set) support in LuaBridge. The changes split the previous combined detection macro into separate macros for flat maps and flat sets, update documentation and tests accordingly, and make several minor code quality improvements. The most important changes are summarized below.

C++23 Flat Container Feature Detection and Support

  • Split the previous LUABRIDGE_HAS_CXX23_FLAT_CONTAINERS macro into two independent feature macros: LUABRIDGE_HAS_CXX23_FLAT_MAP and LUABRIDGE_HAS_CXX23_FLAT_SET, with separate detection logic and disable macros. This allows finer-grained control and avoids enabling flat set support when only flat map is available, and vice versa. (Distribution/LuaBridge/LuaBridge.h, Source/LuaBridge/detail/Config.h, Source/LuaBridge/FlatMap.h, Source/LuaBridge/FlatSet.h, Tests/Source/FlatMapTests.cpp, Tests/Source/FlatSetTests.cpp, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

  • Updated all relevant documentation (README.md, Manual.md) to reflect the new macros and document their usage and requirements separately for flat maps and flat sets. ([[1]](https://github.com/kunitoki/LuaBridge3/pull/254/files#diff-30285cd92fd0939f0eb62dda195f7e2e011c5faf976e86ee95fb2deca76f58e7L96-R98), [[2]](https://github.com/kunitoki/LuaBridge3/pull/254/files#diff-30285cd92fd0939f0eb62dda195f7e2e011c5faf976e86ee95fb2deca76f58e7L1466-R1468), [[3]](https://github.com/kunitoki/LuaBridge3/pull/254/files#diff-30285cd92fd0939f0eb62dda195f7e2e011c5faf976e86ee95fb2deca76f58e7L2533-R2562), [4]

Code Quality and Safety Improvements

  • Added [[maybe_unused]] attributes to unused parameters to suppress compiler warnings and clarify intent in exception-related helper functions. (Distribution/LuaBridge/LuaBridge.h, Source/LuaBridge/detail/Coroutine.h, Source/LuaBridge/detail/Expected.h, [1] [2] [3] [4]

  • Updated SFINAE logic in functor_traits_impl to exclude move-only functions from certain template specializations, improving correctness. (Distribution/LuaBridge/LuaBridge.h, Source/LuaBridge/detail/FuncTraits.h, [1] [2]

Minor Fixes and Cleanups

  • Removed a call to detail::unreachable() after a lua_error call, which is unreachable code. (Distribution/LuaBridge/LuaBridge.h, Source/LuaBridge/detail/LuaHelpers.h, [1] [2]

  • Updated CMake configuration to set the correct compile option for C++23 and later with MSVC. (CMakeLists.txt, CMakeLists.txtR14-R18)

  • Adjusted test code to use more descriptive types and match the new macro names. (Tests/Source/FlatMapTests.cpp, Tests/Source/FlatMapTests.cppL171-R185)

These changes improve feature detection, documentation clarity, and code quality for C++23 flat container support in LuaBridge.

@kunitoki
kunitoki merged commit 0782a94 into master Jul 15, 2026
45 checks passed
@kunitoki
kunitoki deleted the dev/fix_windows branch July 15, 2026 08:14
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