记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:72:18: error: 'reduce' was not declared in this scope
   72 |     std::cout << reduce(c.begin(), c.end(), Complex()) << std::endl;
      |                  ^~~~~~
/in/foo.cc:73:73: error: wrong number of template arguments (0, should be 1)
   73 |     std::cout << reduce(c.begin(), c.end(), Complex(1), std::multiplies<>()) << std::endl;
      |                                                                         ^
In file included from /usr/include/c++/12/string:48,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42,
                 from /usr/include/c++/12/istream:38,
                 from /usr/include/c++/12/sstream:38,
                 from /usr/include/c++/12/complex:45,
                 from /usr/include/c++/12/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:54,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/stl_function.h:205:12: note: provided for 'template<class _Tp> struct std::multiplies'
  205 |     struct multiplies : public binary_function<_Tp, _Tp, _Tp>
      |            ^~~~~~~~~~

信息

递交者
类型
递交
题目
P1011 OO2-1 复数类的算术、赋值运算符的重载
比赛
2024级《面向对象的方法与实践》第二次作业
语言
C++
递交时间
2025-03-23 12:52:35
评测时间
2025-03-23 12:52:35
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes