Releases: ThePhD/sol2
customization-ready
This release adds documentation and the ability to customize the core stack mechanics of the library. New documentation can be found at the usual documentation spot, more specifically a new tutorial page for customization.
This release also fixes a number of minor compiler errors in side cases.
The plan for 3.0 is to wait for the C++ Committee to get itself together and decide on a Reflection scheme, and then ship automatic bindings with that. 'Till then, things are more or less stable now from all feature requests.
simple_usertype, protect and improvements
Note
This release was updated retroactively due to a bug that needed immediate addressing. Please upgrade to the latest if you were on 2.8.10, 2.9.0, or 2.9.1!
In addition to an important bugfix for overloading, this release of sol2
removes all cases of virtual functions for creating and calling functions bound by sol2
or anything else and adds an additional convenience function simple_usertype
for usertype generation.
protect
was added, which allows you to, when binding a function on usertypes, force it to perform checking of arguments.
The documentation on simple_usertype
contains more details on how to use the new function on sol::table
and sol::state(_view)
, new_simple_usertype
, and what it means in terms of how classes are registered (the biggest difference is that all variables are turned into function calls, compatible with how Kaguya and Selene handles them).
Maximum the Speed
This release brings Sol to its theoretical macro-less maximum performance while also adding support for many user requested features (with only a few potential edge cases left). Documentation has been improved and the full tutorial -- from writing variables to usertypes -- is now formally completed.
Some additional features of note:
boost::optional
is now detected and can be used in place ofstd::optional
forsol::optional
's choice of implementationsol::c_call
now provides additional performance by trading in clarity and readability. Use at your own discretion.- All functions bound to Lua can now take
sol::this_state
andsol::variadic_args
(e.g., thetransparent argument
types). This includes property getters and setters. - Casting to bases from a derived class that engages in multiple inheritance is now correct and part of the tests (e.g., regressions won't be tolerated in releases): [ IMPORTANT ] Note that you must specify
sol::base_classes, sol::bases<...>
for this to work proper. - Add a function
table::add( ... )
that 'appends' an entry as if to a linear sequential array. It has caveats to in order to behave this way: see documentation for details. - Add a utility function,
make_reference
, which bolstersmake_object
's capabilities.
Of course, bug fixes and many more new tests to ensure this functionality stays rock-solid.
This release marks being almost done with Sol's extended feature set. Potential addons include utf8/16/32 transformations for char16_t
, char32_t
and friends, as well as convenience wrappers for the Lua debug
API. However, it is unlikely I will have time to commit to these, as I have several summer classes and a lot of Graphics API work I have shelved in order to make 2.8 a reality. I will continue to do bugfixes and releases as necessary, and please do not hesitate to try your own hand at adding to Sol2
(or even tackling one of the features necessary, like a debug
wrapper!).
Thank you for all your support over the months.
sol::object improvements and constructor improvements
This release is mostly a QoI release to make working with sol types easier, specifically sol::object
. sol::object
can now be constructed from many of the more derived sol::reference
types, like sol::table
and sol::thread
and sol::userdata
and sol::(protected_)function
.
luabind compat, make_object for variant returns
This release adds a new function sol::make_object
that will push a value and then create an object representing it, allowing a user to return multiple different types of things from a single function (e.g., for your own variant types). We don't explicitly support a variant until the std::
committee is done fighting over what they want.
Documentation has been updated.
optional fixes, function forwarding semantics
This bugfix release changes the semantics of function
(previously buggy: was meant to fowrard, not copy, arguments) and also fixes optional
usage for reference-based cases (e.g., usertypes).
variadic_args, readonly, and property !
This release adds many additional features both imagined and requested, as well as a handful of fixes including:
sol::variadic_args
- take a variable number of parameters at the end of a function you bind using sol
.
sol::property( &my_class::getter_func, &my_class::setter_func )
- use member functions to implement read-only / write-only (or read-write) variables
sol::readonly( &my_class::some_variable )
- makes a member variable read-only when interacting with set_function
on tables and usertype
.
sol::lib::ffi
and sol::lib::jit
- two libraries made available by luajit that weren't included in the standard sol::lib
enumeration.
Have fun!
Sol v2.3.0 - Tada!
And it's done. The documentation has been updated, and soon we'll have a tutorial! This has been a wonderful ride. Hopefully now we can go into bugfix mode, and only increment the "patch" number of the version!
Sol v2.2.0 - Feature Complete!
This release adds additional safety for getting nested items inside of tables and other things that would normally cause errors if they were tunneled into for tables.
This marks a feature-complete Sol, so far as the original design is concerned and C++ is concerned. The only thing to add later is Variant support, but that's when the C++ standard can catch up to 2010. :B
Sol v2.1.0
This release adds several features to sol for both safety and speed:
* the sol::stack::check_get
and additional safety features that can be turned on at request with SOL_CHECK_ARGUMENTS.
* An implementation of optional
into Sol to work with the said check_get API
* Check whether or not a proxy returned with operator[]
is a currently valid variable
// Check validity of proxy
auto x = table["x"];
if (x.valid()) {
// stuff here
}
// Optional support
sol::optional<int> maybe_x = table["x"];
if (maybe_x) {
my_value = *maybe_x;
}