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

Method initialize

examples/source/usertype_initializers.cpp:32–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 }
31
32 static void initialize(holy& uninitialized_memory) {
33 std::cout << "initializing 'holy' userdata at "
34 << static_cast<void*>(&uninitialized_memory)
35 << std::endl;
36 // receive uninitialized memory from Lua:
37 // properly set it by calling a constructor
38 // on it
39 // "placement new"
40 new (&uninitialized_memory) holy();
41 }
42
43 static void destroy(holy& memory_from_lua) {
44 std::cout << "destroying 'holy' userdata at "

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected