Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ashleighadams/luapp

Lua++, C++11 wrapper for Lua; header only (no linking required)!
https://github.com/ashleighadams/luapp

Last synced: 4 days ago
JSON representation

Lua++, C++11 wrapper for Lua; header only (no linking required)!

Awesome Lists containing this project

README

        

Lua++
=========

![Build Status](http://vps.arb0c.net/build/LuaPP/state.png)

Provides a modern Lua header-only wrapper, utilizing C++11 features and reamining
as close to Lua's syntax as possible.

Some example(s):

```lua
function Test(...)
local args = {...}
for k,v in ipairs(args) do
print(type(v) .. ": " .. tostring(v))
end
end
```

```c++
try
{
Lua::State state;
state.LoadStandardLibary();
state.DoFile("test.lua");

state["Test"]("Hello", Lua::NewTable(), 42, 3.141);

// you can create references to it:
Lua::Variable func = state["Test"];
func("world");
}
catch(Lua::Exception ex)
{
cout << "Lua exception: \n" << ex.what() << "\n";
}
```