记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:209:9: error: invalid initialization of non-const reference of type 'Vector3&' from an rvalue of type 'Vector3'
  V2 = V1*V1;
       ~~^~~
/in/foo.cc:77:7: note:   initializing argument 1 of 'void Vector3::operator=(Vector3&)'
  void operator =(Vector3 &v)
       ^~~~~~~~
/in/foo.cc:210:9: error: invalid initialization of non-const reference of type 'Vector3&' from an rvalue of type 'Vector3'
  V3 = V1*M1;
       ~~^~~
/in/foo.cc:77:7: note:   initializing argument 1 of 'void Vector3::operator=(Vector3&)'
  void operator =(Vector3 &v)
       ^~~~~~~~
/in/foo.cc:211:9: error: invalid initialization of non-const reference of type 'Vector3&' from an rvalue of type 'Vector3'
  V4 = M1*V1;
       ~~^~~
/in/foo.cc:77:7: note:   initializing argument 1 of 'void Vector3::operator=(Vector3&)'
  void operator =(Vector3 &v)
       ^~~~~~~~
/in/foo.cc:212:9: error: invalid initialization of non-const reference of type 'Matrix3&' from an rvalue of type 'Matrix3'
  M2 = M1*M1;
       ~~^~~
/in/foo.cc:172:7: note:   initializing argument 1 of 'void Matrix3::operator=(Matrix3&)'
  void operator =(Matrix3 &M)
       ^~~~~~~~

信息

递交者
类型
递交
题目
P1020 OO4-4 矩阵类与向量类的算术运算符重载
语言
C++
递交时间
2019-06-09 00:58:48
评测时间
2019-06-09 00:58:48
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes