MCPcopy Create free account
hub / github.com/ThePhD/sol2 / main

Function main

examples/source/docs/simple_functions.cpp:5–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <sol/sol.hpp>
4
5int main() {
6 sol::state lua;
7 int x = 0;
8 lua.set_function("beep", [&x] { ++x; });
9 lua.script("beep()");
10 SOL_ASSERT(x == 1);
11
12 sol::function beep = lua["beep"];
13 beep();
14 SOL_ASSERT(x == 2);
15
16 return 0;
17}

Callers

nothing calls this directly

Calls 1

scriptMethod · 0.80

Tested by

no test coverage detected