MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / new_enum

Method new_enum

extlibs/sol3/include/sol/sol.hpp:23121–23132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23119
23120 template <bool read_only = true, typename... Args>
23121 table new_enum(const string_view& name, Args&&... args) {
23122 table target = create_with(std::forward<Args>(args)...);
23123 if (read_only) {
23124 table x = create_with(meta_function::new_index, detail::fail_on_newindex, meta_function::index, target);
23125 table shim = create_named(name, metatable_key, x);
23126 return shim;
23127 }
23128 else {
23129 set(name, target);
23130 return target;
23131 }
23132 }
23133
23134 template <typename T, bool read_only = true>
23135 table new_enum(const string_view& name, std::initializer_list<std::pair<string_view, T>> items) {

Callers

nothing calls this directly

Calls 3

createFunction · 0.85
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected