MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / function

Function function

system/include/emscripten/bind.h:434–448  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

432
433template<typename ReturnType, typename... Args, typename... Policies>
434void function(const char* name, ReturnType (*fn)(Args...), Policies...) {
435 using namespace internal;
436 typename WithPolicies<Policies...>::template ArgTypeList<ReturnType, Args...> args;
437 using ReturnPolicy = typename GetReturnValuePolicy<ReturnType, Policies...>::tag;
438 auto invoke = Invoker<ReturnPolicy, ReturnType, Args...>::invoke;
439 _embind_register_function(
440 name,
441 args.getCount(),
442 args.getTypes(),
443 getSignature(invoke),
444 reinterpret_cast<GenericFunction>(invoke),
445 reinterpret_cast<GenericFunction>(fn),
446 isAsync<Policies...>::value,
447 isNonnullReturn<Policies...>::value);
448}
449
450namespace internal {
451

Callers 2

invokeMethod · 0.70
invokeMethod · 0.70

Calls 3

getSignatureFunction · 0.85
getCountMethod · 0.80
getTypesMethod · 0.80

Tested by

no test coverage detected