如何正确重载<操作符的ostream?
namespace Math{
class Matrix
{
public:
[...]
friend std::ostream& operator<< (std::ostream& stream, const Matrix& matrix);
}}using namespace Math;std::ostream& Matrix::operator <<(std::ostream& stream, const Matrix& matrix) {
[...]}
矩阵cpp:459:错误:‘std:ostream&Math:Matrix:运算符<(std:ostream&,Const Math:Matrix&)’必须使用一个参数
慕仙森
HUWWW
紫衣仙女
梦里花落0921
随时随地看视频慕课网APP
相关分类