记录详情

Compile Error

/in/foo.cc: In instantiation of 'Array<T>& Array<T>::operator=(const Array<T>&) [with T = int]':
/in/foo.cc:11:4:   required from 'void Swap(T&, T&) [with T = Array<int>]'
/in/foo.cc:84:11:   required from here
/in/foo.cc:34:11: error: 'const class Array<int>' has no member named 'szie'; did you mean 'size'?
  size = b.szie;
         ~~^~~~
/in/foo.cc:38:11: error: passing 'const Array<int>' as 'this' argument discards qualifiers [-fpermissive]
   a[i] = b[i];
          ~^
/in/foo.cc:65:4: note:   in call to 'T& Array<T>::operator[](int) [with T = int]'
 T& Array<T>::operator[](int sub)
    ^~~~~~~~
/in/foo.cc: In member function 'Array<T>& Array<T>::operator=(const Array<T>&) [with T = int]':
/in/foo.cc:42:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

信息

递交者
类型
递交
题目
P1012 模板--数组交换
语言
C++
递交时间
2020-04-13 17:24:49
评测时间
2020-04-13 17:24:49
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes