This folder includes a project that demonstrates some of the more sophisticated and complex features of LuaWrapper. Make sure you fully understand the code in example 1 before reading the code here. Example 2 introduces some of the features contained in the luawrapperutil.hpp file which are prefixed with luaU_ instead of luaW_ # Automatic Getter and Setter Generation In example 1, all of the wrapper functions were written manually. It is very common need to write get or set function wrappers - so common in fact that this patter was extracted out into a templated function. In example 1, BankAccount had the following wrapper: int BankAccount_checkBalance(lua_State *L) { BankAccount* account = luaW_check(L, 1); lua_pushnumber(L, account->checkBalance()); return 1; } static luaL_Reg BankAccount_metatable[] = { ... { "checkBalance", BankAccount_checkBalance }, ... }; Rather than write code like that every time you need to create a get function, you can instead just do this: { "checkBalance", luaU_get(L, 1); luaU_push(L, 1.234); Additionally, it is possible to extend this functionality to non-primitive types. A common use is to create a wrapper for std::strings so that you may do this: std::string str1 = luaU_check(L, 1); std::string str2 = "Lua is awesome!" luaU_push(L, str2); Examples of how to create your own luaU_push, luaU_to, and luaU_check can be found in LuaCustomTypes.hpp A visual studio project and makefile are provided, or you can use your own tool chain to compile the example. Once compiled, run example2.exe example2.lua or ./example2 example2.lua to see the code in action.