Function Karana::Core::sharedPtrDiscardVec#
Defined in File pybind11Utils.h
Function Documentation#
-
inline 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 sequence.
Clears the sequence 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:
bases – The Sequence of bases we want to discard.