记录详情

Compile Error

foo.cc: In member function ‘PolyList PolyList::operator+(const PolyList&)’:
foo.cc:27:41: error: passing ‘const PolyList’ as ‘this’ argument discards qualifiers [-fpermissive]
   27 |                 p.m_sum = m_sum + p.ASum();
      |                                   ~~~~~~^~
foo.cc:38:13: note:   in call to ‘int PolyList::ASum()’
   38 |         int ASum()
      |             ^~~~
foo.cc:27:25: error: assignment of member ‘PolyList::m_sum’ in read-only object
   27 |                 p.m_sum = m_sum + p.ASum();
      |                 ~~~~~~~~^~~~~~~~~~~~~~~~~~

信息

递交者
类型
自测
题目
P1021 OO5-1 一元多项式类的求值
语言
C++
递交时间
2024-04-05 16:46:15
评测时间
2024-04-05 16:46:15
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes