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

Function simple

examples/source/environment_snooping.cpp:7–18  ·  view source on GitHub ↗

Simple sol2 version of the below

Source from the content-addressed store, hash-verified

5
6// Simple sol2 version of the below
7void simple(sol::this_state ts, sol::this_environment te) {
8 sol::state_view lua = ts;
9 if (te) {
10 sol::environment& env = te;
11 sol::environment freshenv = lua["freshenv"];
12 bool is_same_env = freshenv == env;
13 std::cout << "this_environment -- env == freshenv : "
14 << is_same_env << std::endl;
15 }
16 std::cout << "this_environment -- no environment present"
17 << std::endl;
18}
19
20// NOTE:
21// THIS IS A LOW-LEVEL EXAMPLE, using pieces of sol2

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected