例えば、
Matrix.h
namespace Matrix
{
class mat
{
public:
mat(int row, int col);
const mat &operator=(const mat &rhs);
}
}
マトリックス.cpp
Matrix::mat::mat(int row, int col)
{ // implementation here }
const Matrix::mat &Matrix::mat::operator=(const mat &rhs)
{ // implementation here }
上記のコードは問題なくコンパイルされます。問題は、名前空間識別子をパラメーターの前に配置する必要があるconst mat operator=(const Matrix::mat &rhs);
か
const Matrix::mat Matrix::mat::operator=(const Matrix::mat &rhs)
どうかです。これを行うための規則的な方法と、識別子を追加せずにコンパイルする理由は何ですか?