Template Function Karana::Core::createSharedPtrDiscard

Template Function Karana::Core::createSharedPtrDiscard#

Function Documentation#

template<typename T, typename R, typename ...Args>
auto Karana::Core::createSharedPtrDiscard(R (*f)(Args...))#

Registers a discard for a Python object using a shared pointer on create. This works by using a weakref.finalize function that calls the discard method if the use count of the shared pointer is <= 2.

Parameters:

f – - The function used to create the object.