Skip to content

Releases: ThePhD/sol2

heavy internal improvements and fixes

22 Sep 17:04
Compare
Choose a tag to compare

This is a minor version change but has some significant changes that improve the reliability and performance of sol2.

  • This release adds a massive performance boost for usertypes with a large number of members, furthering the actual speed advantage of sol2 (thanks @OrfeasZ!)
  • A number of bugs concerning inheritance and indexing were fixed
  • A stack bug for access of scripts and multiple keys for proxies was fixed
  • New examples were added to the examples directory for common cases (especially the new require example and namespacing example)

simple_usertype, not so simple anymore

14 Sep 04:11
Compare
Choose a tag to compare

This release heavily improves simple_usertype to make it equivalent and equal to the usertype. It introduces a breaking change in that variables are no longer serialized as functions: to do that, one must wrap any bindings in sol::as_function.

The caveats and problems are no longer present from old versions, and the documentation has been updated: http://sol2.readthedocs.io/en/latest/api/simple_usertype.html

sol::as_function, as mentioned before, will now turn any "my_variable", &my_type::my_variable binding entry into a callable function.

Have fun!

Abstract Reference Classes

11 Sep 01:00
Compare
Choose a tag to compare

This release fixes up the bad semantics of std::optional and replaces those semantics in sol::optional. Users using boost::optional are unaffected because the boost implementation isn't stupid.

It also fixes some other minor bugs. Feel free to update to get the latest goodies.

LuaJIT Beta Bugfix

04 Sep 15:47
Compare
Choose a tag to compare

This release adds a define to help those who want to use the latest LuaJIT, which has improved its compatibility and no longer needs certain functions.

Bugfixes

31 Aug 06:02
Compare
Choose a tag to compare

This is a bugfix release to take care of reported issues since the last release. It is encouraged individuals upgrade since these bugfixes are valuable and useful to solving a number of common problems.

STL Containers: version 2

31 Aug 06:02
Compare
Choose a tag to compare

This release adds support for STL Containers in a second style which does not break preexisting code but satisfies user expectations for both setting and receiving STL Containers from Lua using Sol. It is a breaking change from how it was handled previously by default, and the old behavior can be requested using the new as_table marker on a container type when pushing data to Sol or retrieving data from Sol.

Everyone is encouraged to upgrade to the latest immediately, and thanks to everyone who reported bugs with the previous haphazard implementation!

retrieve STL containers from table types

31 Aug 06:01
Compare
Choose a tag to compare

This release adds some minor fixes and adds a new type of getter -- one for stl-containers that are associative and non-associative.

This release also fixes some issues with usertype inheritance, though keep in mind that is still officially unsupported and undocumented and should be used with caution (since the performance can degrade linearly with the 'class distance' from derived to bases).

Another issue with using certain kinds of wrapped pointers are managed types were also fixed here.

Automatic comparator bindings

27 Aug 12:48
Compare
Choose a tag to compare

This release adds some shiny new automatic comparator bindings to help with equality and comparison expectations for C++ types bound in Lua.

It also makes sure weird containers like std::set work.

Small fix for constness and volatileness on OSX.

sol::object in_place constructor, better examples

17 Aug 05:20
Compare
Choose a tag to compare

All of the examples in the examples directory got beefed up and reworked, to better show how to use sol2. We also improved performance for the related benchmarks and also benchmark against the old sol2.

There is tentative support (but currently undocumented) for automatically looking up base class variables on metatables. It is currently not recommended because there is a significant overhead in non-trivial cases: the recommendation in the docs to continue specifying all member functions / variables -- including base ones -- stays for now, and this will remain undocumented until the speed becomes less shit.

The addition of sol::factories( ... ) for usertypes, to allow people to specify a factory function without automatically getting a new function.

Support for std::wstring, std::u16string, std::u32string by converting them to std::string's and serializing them into Lua as utf8, before deserializing them into whatever target string based on what someone does a get/set with.

sol::object now has an in_place and in_place<T> constructor, to create arbitrary objects. This supersedes make_object, but both will continue to be present.

Many small bugs were also fixed, including some const-ness issues and some return type issues for sol::reference derived types (thanks to @Nava2 for reporting!).

Unless a new feature appears, this is possibly the latest and greatest version of sol2.

sol::var, sol::property, sol::as_function, improvements

08 Aug 01:07
Compare
Choose a tag to compare

This release adds some minor touchups to performance, removes the need for RTTI (we can get type names without it now), exposes a function-disambiguator (useful for lambdas) called as_function and adds a new feature, sol::var.

sol::as_function was inspired by @Nava2 needing to handle functions better, and it turned out to help the next person mentioned for the other feature as well! Thanks for bringing it up.

sol::var was inspired by https://twitter.com/eevee and is something I probably should have caught sooner, but yay twitter (thanks @eliasdaler for looping me into the conversation)!

Also noteworthy is that @eevee also pointed out that lambdas should work with property, not just member variables/functions. So, that's now fixed and ready to go too!

Everyone should upgrade, since this is a non-breaking usability improvement.