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
One of the helpful capabilities of the STL shared_ptr class is the ability to define, at initialization, the deleter function which will be used to clean up a particular object instance. And each shared_ptr keeps track of its deleter function for that specific data instance.
It seems like the current M-SHARED-PTR only supports compile-time definition of a CLEAR function, which fits the type-safe nature of M*LIB but limits its ability to handle situations where different contained-data uses are handled by the same pointer type.
Is adding this kind of parity with the STL class desirable in M*LIB? Maybe by a different container than M-SHARED-PTR?
The text was updated successfully, but these errors were encountered:
The current M_SHARED_PTR interface does indeed only support compile-time definition of the destructor.
I'm not sure why C++ has added this run-time property of their shared pointer, but I suppose it is due to class inheritance (The shared_ptr is the only pointer remaining when the shared pointer is destroyed, but it shall call the overloaded destructor of one of its inherited class).
I don't see any value in supporting it in M*LIB. Moreover, the user code can quite easily emulate it itself by adding its own function pointer (or using a VARIANT for the encapsulated object).
One of the helpful capabilities of the STL
shared_ptr
class is the ability to define, at initialization, the deleter function which will be used to clean up a particular object instance. And eachshared_ptr
keeps track of its deleter function for that specific data instance.It seems like the current
M-SHARED-PTR
only supports compile-time definition of a CLEAR function, which fits the type-safe nature of M*LIB but limits its ability to handle situations where different contained-data uses are handled by the same pointer type.Is adding this kind of parity with the STL class desirable in M*LIB? Maybe by a different container than
M-SHARED-PTR
?The text was updated successfully, but these errors were encountered: