Template Function lsst::utils::python::addSharedPtrEquality¶
Function Documentation¶
- 
template<typename T, typenamePyClass>
 voidlsst::utils::python::addSharedPtrEquality(PyClass &cls)
- Add - __eq__and- __ne__methods based on two std::shared_ptr<T> pointing to the same address- Example: - Template Parameters
- T: The type to which the std::shared_ptr points.
- PyClass: The pybind11 class_ type; this can be automatically deduced.
 
 - lsst::afw::table records are considered equal if two - std::shared_ptr<record>point to the same record. This is wrapped as follows for- lsst::afw::table::BaseRecord, where- clsis an instance of- pybind11::class_<BaseRecord, std::shared_ptr<BaseRecord>>):- utils::addSharedPtrEquality<BaseRecord>(cls); - Note that all record subclasses inherit this behavior without needing to call this function.