演算子 + をオーバーロードすることは可能ですか
template <typename U>
Mat <T> operator + ( const Mat <U> &A );
次の行列演算
Matrix (1,1) + scalar = scalar
scalar + Matrix (1,1) = scalar
Matrix(1,1) + Matrix(1,1) = scalar
と構文(または同様)?
template <typename T, typename U>
T operator + ( const Mat <U> &M ) const;
更新された質問:
テンプレート パラメータとしての寸法:
template <typename T, typename U, const unsigned int TDim>
T operator + ( const Mat <U> &M, TDim <dim> ) const;
dim=1 の特殊化で
template <typename T, typename U>
T operator + ( const Mat <U> &M, TDim <1> ) const;