File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
system/include/emscripten Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1475,6 +1475,24 @@ namespace emscripten {
14751475 return *this ;
14761476 }
14771477
1478+ template <typename ... Args, typename ReturnType, typename ... Policies>
1479+ EMSCRIPTEN_ALWAYS_INLINE const class_& constructor (ReturnType (*factory)(Args...), Policies...) const {
1480+ using namespace internal ;
1481+
1482+ // TODO: allows all raw pointers... policies need a rethink
1483+ typename WithPolicies<allow_raw_pointers, Policies...>::template ArgTypeList<ReturnType, Args...> args;
1484+ auto invoke = &Invoker<ReturnType, Args...>::invoke;
1485+ _embind_register_class_constructor (
1486+ TypeID<ClassType>::get (),
1487+ args.getCount (),
1488+ args.getTypes (),
1489+ getSignature (invoke),
1490+ reinterpret_cast <GenericFunction>(invoke),
1491+ reinterpret_cast <GenericFunction>(factory));
1492+
1493+ return *this ;
1494+ }
1495+
14781496 template <typename SmartPtr, typename ... Args, typename ... Policies>
14791497 EMSCRIPTEN_ALWAYS_INLINE const class_& smart_ptr_constructor (const char * smartPtrName, SmartPtr (*factory)(Args...), Policies...) const {
14801498 using namespace internal ;
You can’t perform that action at this time.
0 commit comments