10 KiB
Vendored
10 KiB
Vendored
Version 3.0
- Moved to C++17 as minimum supported standard C++ version.
- Reworked the whole library to be able to use it without c++ exceptions enabled.
- Lot of optimisations have been added, and now the library is fast, nearly in the same league as sol2 v3.x.
- Breaking Change: The method
Stack<T>::pushnow takes astd::error_code&as last parameter and returns abool. - Breaking Change: The class
LuaExceptionhas been reworked and it now take astd::error_codeinstead of a int. - Breaking Change: The class
LuaExceptionis now thrown if a unregistered class is pushed via the Stack class, also when callingLuaRef::operator(), but only if exceptions are enabled. - Breaking Change:
LuaRef::operator()now returns the classLuaResult, where it is possible to obtain the call results or error message. - Breaking Change: LuaBridge does not silently enable exceptions when calling
getGlobalNamespace. CallenableExceptions(lua_State*)if you want to enable them explicitly. - Breaking Change: Removed
RefCounterPtr, maintaining the reference counts in a unsynchronized global table is not production quality. - Breaking Change: Removed
Class<T>::addStaticData, it was just an alias forClass<T>::addStaticProperty. - Breaking Change: Removed
Class<T>::addCFunction, it was just an alias forClass<T>::addFunction. - Breaking Change: Removed
Class<T>::addStaticCFunction, it was just an alias forClass<T>::addStaticFunction. - Allow specifying a non virtual base class method when declaring class members (functions or variables) not exposed in the inherited class.
- Allow using capturing lambdas in
Namespace::addFunction,Namespace::addProperty,Class<T>::addFunction,Class<T>::addStaticFunction,Class<T>::addPropertyandClass<T>::addStaticProperty. - Added multiple inheritance support:
deriveClassnow accepts more than one registered base class (e.g.deriveClass<D, A, B>). - Added C++20 coroutine integration:
CppCoroutine<R>type that can be registered viaNamespace::addCoroutine()to expose C++ generators to Lua usingco_yieldandco_return. - Added
LuaCoroutineawaitable to resume a child Lua thread synchronously from inside aCppCoroutinebody usingco_await. - Added
lua_resume_xandlua_isyieldable_xportable helpers inLuaBridge/detail/LuaHelpers.h. - Added
LUABRIDGE_HAS_CXX20_COROUTINESfeature-detection macro; opt out withLUABRIDGE_DISABLE_CXX20_COROUTINES. - Added
ErrorCode::CoroutineYieldFromNonCoroutineandErrorCode::CoroutineAlreadyDoneerror codes. - Added
Namespace::addVariableto allow adding a modifiable value by copy into the namespace without incurring in function calls or metatables generation. - Added
luabridge::callWithHandlerfree function andLuaRef::callWithHandlermember to provide a custom Lua message handler duringlua_pcall. - Added
luabridge::newFunctionfree function andLuaRef::newFunctionstatic method to wrap any C++ callable into a Lua function exposed as aLuaRef. - Added
luabridge::getNamespaceFromStackfunction to construct a namespace object from a table on the stack. - Added
luabridge::registerMainThreadfunction especially useful when using lua 5.1 to register the main lua thread. - Added
std::shared_ptrsupport for types intrusively deriving fromstd::enable_shared_from_this. - Added
Class<T>::addConstructorsupport for specifying factory functor to do placement new of the object instance. - Added
Class<T>::addDestructorto register a custom__destructmetamethod hook invoked just before the C++ destructor runs. - Added
Class<T>::addFunctionoverload taking alua_CFunctionas if it were a member. - Added
Class<T>::addIndexMetaMethodto allow register__indexmetamethod fallback on a registered class. - Added
Class<T>::addNewIndexMetaMethodto allow register__newindexmetamethod fallback on a registered class. - Added
Class<T>::addStaticIndexMetaMethodfor fallback__indexhandling on the static class table. - Added
Class<T>::addStaticNewIndexMetaMethodfor fallback__newindexhandling on the static class table. - Added
LuaRef::isValidto check when the reference is a LUA_NOREF. - Added
LuaRef::isCallableto check when the reference is a function or has a__callmetamethod. - Added
LuaException::stateto return thelua_Stateassociated with the exception. - Added
void*andconst void*stack specializations mapped transparently to Lua lightuserdata. - Added support for
std::byteas stack value type. - Added support for
std::string_viewas stack value type. - Added support for
std::tupleas stack value type. - Added support for
std::optionalas stack value type. - Added support for
std::setas stack value type by usingLuaBridge/Set.h. - Added support to
LuaReffor being hashed withstd::hash(LuaRefproperly usable instd::unordered_map). - Added
LuaRef::appendand variadicLuaRef::append(vs...)to append values to a Lua sequence table usinglua_rawseti. - Added
LuaRef::call<R>()now returns a strongly-typedTypeResult<R>instead of a genericLuaResult;LuaRef::operator()returnsTypeResult<void>. - Added
LUABRIDGE_STRICT_STACK_CONVERSIONScompile-time flag to enforce strict type-safe stack conversions (boolrequiresLUA_TBOOLEAN,std::stringrequiresLUA_TSTRING). - Added
LuaFunction<Signature>strongly-typed wrapper class for invoking Lua functions with compile-time argument and return-type checking. - Added
TypeResult<T>::valueOr(default)to extract the contained value or return a fallback when a cast fails. - Added
allowOverridingMethodsclass option to permit Lua scripts to override C++ methods registered in an extensible class. - Added single header amalgamated distribution file, to simplify including in projects.
- Added more asserts for functions and property names.
- Renamed
luabridge::Niltoluabridge::LuaNilto allow including LuaBridge in Obj-C sources. - Removed the limitation of maximum 8 parameters in functions.
- Removed the limitation of maximum 8 parameters in constructors.
- Removed
Class<T>::addData, it was just an alias forClass<T>::addProperty. - Removed
TypeListfrom loki, using parameter packs andstd::tuplewithstd::apply. - Removed juce traces from unit tests, simplified unit tests runs.
- Changed all generic functions in
LuaRefandTableItemto accept arguments by const reference instead of by copy. - Fixed
Stack<bool>::getto properly requireLUA_TBOOLEANwhenLUABRIDGE_STRICT_STACK_CONVERSIONSis enabled; without the flag, legacylua_tobooleansemantics are preserved. - Fixed floating-point
Stack<T>::push,get, andisInstanceto correctly allow NaN and Inf values to pass through without error. - Fixed issue when
LuaRef::cast<>fails with exceptions enabled, popping from the now empty stack could trigger the panic handler twice. - Fixed unaligned access in user allocated member pointers in 64bit machines reported by ASAN.
- Fixed access of
LuaRefin garbage collectedlua_thread. - Included testing against Luau VM
- Included testing against Ravi VM
- Bumped lua 5.2.x in unit tests from lua 5.2.0 to 5.2.4.
- Bumped lua 5.4.x in unit tests from lua 5.4.1 to 5.4.8.
- Added Lua 5.3.6 and 5.5.0 in unit tests.
- Run against PUC-Lua, Luau, LuaJIT and Ravi in CI.
- Converted the manual from html to markdown.
- Small improvements to code and doxygen comments readability.
- Support for
__fastcallfunction pointers.
Version 2.6
- Added namespace
addFunction()acceptingstd::function(C++11 only). - Added class
addStaticFunction()acceptingstd::function(C++11 only). - Update the Doxygen documentation.
- Add brief API reference into the manual.
- Hide non-public
luabridgemembers into thedetailnamespace. - Fix stack cleanup by
LuaRef::isInstance()method.
Version 2.5
- Introduce stack
isInstance()method. - Introduce LuaRef
isInstance()method. - Added a convenience
isInstance()function template.
Version 2.4.1
- Do not call the object destructor then its constructor throws.
Version 2.4
- String stack get specialization doesn't change the stack value anymore.
- Added namespace
addProperty()accepting C-functions. - Introduce enableExceptions function.
Version 2.3.2
- Fixed registration continuation for an already registered class.
Version 2.3.1
- Fixed registration continuation issues.
Version 2.3
- Added class
addFunction()accepting proxy functions (C++11 only). - Added class
addFunction()acceptingstd::function(C++11 only). - Added class
addProperty()accepting functions with lua_State* parameter. - Added class
addProperty()acceptingstd::function(C++11 only). - Added stack traits for
std::unordered_map(UnorderedMap.h). - Now using lightuserdata for function pointers.
Version 2.2.2
- Performance optimization.
Version 2.2.1
- Refactored namespace and class handling.
Version 2.2
- Refactored stack operations.
- Handle exceptions in stack operations.
Version 2.1.2
- Added
operator==andoperator!=forRefCountedPtrtemplate.
Version 2.1.1
- Support for
__stdcallfunction pointers.
Version 2.1
- Added stack traits for
std::vector(Vector.h). - Added stack traits for
std::list(List.h). - Added stack traits for
std::map(Map.h). - Added ability to use
LuaRefobjects as anstd::mapkeys. - Fixed some manual errata.
Version 2.0
- Numerous bug fixes.
- Feature Requests from Github issues.
- Added
LuaRefobject. - Rewritten documentation.
Version 1.1.0
- Split code up into several files.
- Add Lua table and type representations (based on Nigel's code).
- Reformat documentation as external HTML file.
Version 1.0.3
- Pass
nilto Lua when a null pointer is passed for objects with shared lifetime.
Version 1.0.2
- Option to hide metatables selectable at runtime, default to true.
addStaticMethod()renamed toaddStaticFunction()for consistency.addMethod()renamed toaddFunction()for consistency.addCFunction()registrations.- Convert null pointers to and from
nil. - Small performance increase in class pointer extraction.
Version 1.0.1
- Backward compatibility with Lua 5.1.x.
Version 1.0
- Explicit lifetime management models.
- Generalized containers.
- Single header distribution.