automatic operators, C++17 support, as_container, LuaJIT beta and more
This is an enormous improvement release that adds several new features, including support for many household name C++17 types (variant and the like). It also includes a small amount of integer handling safety thanks to @mrgreywater and some inspiration for handling and dealing with containers types thanks to @iaz3 .
Notables:
- NEW Container support, overhauled and overridable by users (inspired by @s13n): http://sol2.readthedocs.io/en/latest/containers.html
- A new example for using
require
in Lua code with a DLL that is built with sol2: https://github.com/ThePhD/sol2/tree/develop/examples/require_dll_example - A new example for working with containers and messing with traits: https://github.com/ThePhD/sol2/blob/develop/examples/container_usertype_as_container.cpp
- Additional automatically-generated usertype operations, including
tostring
andpairs
(pairs
metamethod is only available in Lua 5.2+): https://github.com/ThePhD/sol2/blob/develop/examples/usertype_automatic_operators.cpp - Overloading fallbacks for constructors and functions using
variadic_args
: https://github.com/ThePhD/sol2/blob/develop/examples/overloading_with_fallback.cpp - New number handling for safety, triggered by
SOL_CHECK_ARGUMENTS
. See this page for more information about safety changes: http://sol2.readthedocs.io/en/latest/safety.html#config
This release also introduces:
- necessary thread safety usages when creating multiple states across threads (solving #458)
- some new functions to work safely with called code: http://sol2.readthedocs.io/en/latest/api/state.html#state-script-function
- additional handling for
__stdcall
on x86, solving @Horatii's issue in #463 permanently (thanks for introducing a good fix on x86, @Horatii) - Support for g++ 7.x.x and Visual Studio 2017+