I have created a Matrix class that does some basic math and such stuff. This class has defined copy and move constructors and operators.
What I have noticed is that when I use syntax like (for example):
Matrix Multiply(const Matrix &A, const Matrix &B)
{
Matrix C;
C.Resize(A.Rows,B.Cols);
//perform actions
return std::move(C); //(1)
}
Both move constructor and move operator is used. But when I use instead (1) just:
return C;only move operator is used. Which approach is valid? Why call two functions (constructor and operator) if one can call only one?
Thanks and Regards.






