MCPcopy Create free account
hub / github.com/covscript/covscript / modify_function

Function modify_function

tests/reflection.cpp:27–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26template<typename...ArgsT>
27void modify_function(cs::var &func, ArgsT &&...args) {
28 int level = remove_protect(func);
29 func.swap(cs::var::make<cs::callable>(std::forward<ArgsT>(args)...), true);
30 set_protect(func, level);
31}
32
33CNI_ROOT_NAMESPACE {
34 CNI_V(privileged_do, [](cs::var &val, const cs::var &func) {

Callers 1

reflection.cppFile · 0.85

Calls 3

remove_protectFunction · 0.85
set_protectFunction · 0.85
swapMethod · 0.45

Tested by

no test coverage detected