Function Karana::Core::sharedPtrDiscardVec

Function Karana::Core::sharedPtrDiscardVec#

Function Documentation#

void Karana::Core::sharedPtrDiscardVec(py::typing::Sequence<Base> &bases)#

pybind11 utility used for discard method with sequences of shared pointers.

This does the following:

  • Discards ever member in the vector.

  • Clears the vector itself.

In Python, this leaves us with an empty list, tuple, etc. We cannot find and remove the variable from the local scope as we do for the single-Base version, as creating a py::handle via py::cast creates a new sequence object, so comparisons with variables won’t turn up any matches like they do for the single-Base case.

Parameters:

base – The Base* class that we want to discard.