sol2 is a C++ library binding to Lua. It currently supports all Lua versions 5.1+ (LuaJIT 2.0+ and MoonJIT included). sol2 aims to be easy to use and easy to add to a project. The library is header-only for easy integration with projects, and a single header can be used for drag-and-drop start up. sol2 makes use of C++17 features. GCC 7.x.x and Clang 3.9.x (with -std=c++1z and appropriate standard library) or higher should be able to compile without problems. sol2 is checked by-hand for other platforms as well, including Android-based builds with GCC and iOS-based builds out of XCode with Apple-clang. It should work on both of these platforms, so long as you have the proper standards flags. If something doesn't work or you need special options, you may need to look into the different ways to support the project to have it done for you!
Features
- Fastest in the land (see: sol2 bar in graph)
- Supports retrieval and setting of multiple types
- Lambda, function, and member function bindings are supported
- Intermediate type for checking if a variable exists
- Simple API that completely abstracts away the C stack API, including protected_function with the ability to use an error-handling function
- C++ type representations in Lua userdata as usertypes with guaranteed cleanup