You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of my C++ codebase uses shared_ptr for all pointers passed around - this makes it awkward interfacing with JS code that creates new objects - I'm either forced to use raw pointers in my C++ classes, or implement my own factory functions to expose to JS instead of using new.
Would it be possible to add an overridden constructor declaration that creates a shared_ptr and passes that down rather than T*?
Most of my C++ codebase uses shared_ptr for all pointers passed around - this makes it awkward interfacing with JS code that creates new objects - I'm either forced to use raw pointers in my C++ classes, or implement my own factory functions to expose to JS instead of using new.
Would it be possible to add an overridden constructor declaration that creates a shared_ptr and passes that down rather than T*?
e.g.
dukglue_register_constructor_sharedptr<TestClass>(ctx, "TestClass");
that would do exactly the same functionality as dukglue_register_constructor but would use make_shared instead of new internally.
The text was updated successfully, but these errors were encountered: