记录详情

Compile Error

foo.cc: In member function 'Vector3 Vector3::operator*(const Vector3&)':
foo.cc:23:11: error: no matching function for call to 'Vector3::Vector3()'
   23 |   Vector3 b;
      |           ^
foo.cc:15:2: note: candidate: 'Vector3::Vector3(int, int, int)'
   15 |  Vector3(int x1, int y1, int z1)
      |  ^~~~~~~
foo.cc:15:2: note:   candidate expects 3 arguments, 0 provided
foo.cc:9:2: note: candidate: 'Vector3::Vector3(const Vector3&)'
    9 |  Vector3(const Vector3& V)
      |  ^~~~~~~
foo.cc:9:2: note:   candidate expects 1 argument, 0 provided
foo.cc: In member function 'Vector3 Vector3::operator*(int)':
foo.cc:31:11: error: no matching function for call to 'Vector3::Vector3()'
   31 |   Vector3 b;
      |           ^
foo.cc:15:2: note: candidate: 'Vector3::Vector3(int, int, int)'
   15 |  Vector3(int x1, int y1, int z1)
      |  ^~~~~~~
foo.cc:15:2: note:   candidate expects 3 arguments, 0 provided
foo.cc:9:2: note: candidate: 'Vector3::Vector3(const Vector3&)'
    9 |  Vector3(const Vector3& V)
      |  ^~~~~~~
foo.cc:9:2: note:   candidate expects 1 argument, 0 provided
foo.cc: In member function 'Vector3 Vector3::operator+(const Vector3&)':
foo.cc:39:11: error: no matching function for call to 'Vector3::Vector3()'
   39 |   Vector3 b;
      |           ^
foo.cc:15:2: note: candidate: 'Vector3::Vector3(int, int, int)'
   15 |  Vector3(int x1, int y1, int z1)
      |  ^~~~~~~
foo.cc:15:2: note:   candidate expects 3 arguments, 0 provided
foo.cc:9:2: note: candidate: 'Vector3::Vector3(const Vector3&)'
    9 |  Vector3(const Vector3& V)
      |  ^~~~~~~
foo.cc:9:2: note:   candidate expects 1 argument, 0 provided
foo.cc: In member function 'Vector3 Vector3::operator-(const Vector3&)':
foo.cc:47:11: error: no matching function for call to 'Vector3::Vector3()'
   47 |   Vector3 b;
      |           ^
foo.cc:15:2: note: candidate: 'Vector3::Vector3(int, int, int)'
   15 |  Vector3(int x1, int y1, int z1)
      |  ^~~~~~~
foo.cc:15:2: note:   candidate expects 3 arguments, 0 provided
foo.cc:9:2: note: candidate: 'Vector3::Vector3(const Vector3&)'
    9 |  Vector3(const Vector3& V)
      |  ^~~~~~~
foo.cc:9:2: note:   candidate expects 1 argument, 0 provided
foo.cc: In member function 'Vector3& Vector3::operator=(const Vector3&)':
foo.cc:58:2: warning: no return statement in function returning non-void [-Wreturn-type]
   57 |   z=a.z;
  +++ |+  return *this;
   58 |  }
      |  ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
自测
题目
P1017 OO4-1 向量类的算术运算符的重载
语言
C++
递交时间
2022-04-29 21:33:30
评测时间
2022-04-29 21:33:30
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes