Question about the operator overriding for operator+=(Mat a, Mat b): does it ever exist?

Hello everyone.

  1. please open this file: modules\core\src\matrix_expressions.cpp
  2. please look at this function:

void MatOp::augAssignAdd(const MatExpr& expr, Mat& m) const
Mat temp;
expr.op->assign(expr, temp);
m += temp;

  1. as you can see, m is type of Mat&, while temp is type of Mat.
    And there is a line of code: m += temp;

  2. according to my knowledge of C++ so far, I think there must exists some operator overriding like following:

template static inline
Mat_<Tp>& operator += (Mat<_Tp>& a, Mat<_Tp>& b)
// blah blah blah

  1. however, after some search/research, I got no result.

So could you anybody give me some hint how the operator += can work here?
Thank you.

1 Like