Releases: ThePhD/sol2
to_args and thread changes
This minor release adds a new construct for argument passing from C++ to Lua and also adds some minor changes to thread
to make it easier to work with.
- New
as_args
, as basically requested by @eevee: http://sol2.readthedocs.io/en/latest/api/as_args.html- Note that the implementation of this was piss-easy to do as a customization point: if you need a feature, you can probably implement it as a customization point
- Documentation updates
- New constructor and member function for thread: http://sol2.readthedocs.io/en/latest/api/thread.html
[Important] Double-Free Fix, Bit32 Compatibility
This release of sol2 addresses a double-free bug within the library present for closures and other things using the user abstraction. Users are encouraged to upgrade basically right now.
Fixes:
- #281 Latest bug where closure gets doubled freed and it seemed like a referencing issue
- Twitter bug reported by @eevee https://twitter.com/eevee/status/801255925440856065
- #282 bit32 compat when defining LUA_COMPAT_52 or LUA_COMPAT_BITLIB
Exception (and no Exceptions) improvements and documentation
This release fixes some derps in the code to handle not having exceptions defined, as well as a caveat for full exception interopability pointed out and fixed by @aaiyer !
- New Error Documentation: http://sol2.readthedocs.io/en/latest/errors.html
constexpr
resolve: http://sol2.readthedocs.io/en/latest/api/resolve.html- Better Exception Documentation: http://sol2.readthedocs.io/en/latest/exceptions.html
- New definition
#define SOL_EXCEPTIONS_SAFE_PROPAGATION
for when the Lua framework can handle all classes of "..." exceptions: http://sol2.readthedocs.io/en/latest/exceptions.html#lua-and-luajit-c-exception-full-interoperability
- New definition
- MAME is now using sol2: http://sol2.readthedocs.io/en/latest/mentions.html
STL containers, Less Submodules, improvements
There's a lot of new fixes and features in this release, which also comes with a wave of new documentation to describe everything.
- Container documentation is now available to help people use containers better.
- do_string and other more friendly functions are now present.
- Error handling tips and tricks! This one should help a lot of people.
- Documentation for read-only tables in online and should help guide people.
- Usertype has a top-level category in the documentation for lots of goodness.
- Specialization traits now have a top-level category to describe their usefulness. (A bug with the
is_container
trait was also fixed: thanks crazyc and MAME!) - We no longer submodule the Optional header, since it has changes so drastic from the initial implementation we changed. It is now included in the rest and nobody has to recursively initialize submodules anymore to pull from the Git repository.
Checker/Getter Fixes, Usertype documentation
This release adds new usertype documentation and fixes a few of the ways usertype
s interact with the rest of the Lua runtime. It has been streamlined to avoid any particular problems, and overload resolution now takes into account if there's only 1 overload, bypassing any checking and simply calling the desired target function like it regularly would.
Integer Checking
This release makes sure that integers can be separated from regular numbers in Lua 5.3, but also in Lua 5.2 and below. The check is a tad expensive, but thankfully it's not on by default and you're welcome to cast away to your heart's content.
Fixes:
#247
usertype performance overhaul and better checking
This update fixes several bugs and applies a new way of handling usertypes that provides better guarantees for table modification and improves usertype performance.
Fixes #244 - simple_usertype no longer forcefully takes a hit under many circumstances
Docs have also been touched up in places, thanks to some suggestions from @eliasdaler. This release is also the one going to Lua Workshop 2016!
function, object and checker fixes
This release fixes some minor derps in stack::check
, and also adds a few new operator=
and constructors to make objects a bit easier to deal with. It closes #236 and #237, and solves #238, making protected_function
work as intended.
#243 and #242 are fixed as well, though #242 implies that we lose some ability to pre-allocate some space for as_table
conversions, which is unfortunate. But! Most people should be using the usertype
variants of the containers, which is good for us!
Proper reference semantics for container access
This release fixes a minor bug with container access, where it pushes a copy rather than a reference to items in a container type bound on a usertype (oops).
The good news is, there's tests for all these now, so it'll never happen again.
protected_function
now has a constructor that can take 2 Lua References. This means you can pass the function to grab and the error function as well. It is also important to note you can also use sol::protected_function::set_default_handler( lua["my_handler"] );
to have a perpetual default handler.
Finally, also fixed a bug where users member function call optimizations on a blank simple_usertype that was added to later would fail. Now it works properly.
constexpr was fixed and the size of sol::optional should be a bit smaller now. GCC 4.9 and less users will not get all the hot kinky constexpr optional, though: not like they can, because GCC 4.9 and below doesn't have relaxed constexpr in the first place...!
VC++ Tuple order
Fixes a bug with VC++'s tuple constructor order, among other small minor changes.