Skip to content

Sol v2.1.0

Compare
Choose a tag to compare
@ThePhD ThePhD released this 25 Mar 15:05
· 1906 commits to develop since this release

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;
}