is it possible to Overload pythons + operator using the Python C API.
for example if i run this code in python:
C = A+B
id like to be able to call this function written in c++
template<typename T>
QSMatrix<T> QSMatrix<T>::operator+(const QSMatrix<T>& rhs) {
QSMatrix result(rows, cols, 0.0);
for (unsigned i=0; i<rows; i++) {
for (unsigned j=0; j<cols; j++) {
result(i,j) = this->mat[i][j] + rhs(i,j);
}
}
return result;}
is doing this possible?