急!急求帮助!=操作符重载

spch2008 spch2008 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
template <class T>
SeqList<T>& SeqList<T>::operator=(SeqList<T>& L)
{
if(this == &L) return *this;
T value;
int n = L.Length();
T* ptr = &L; //error C2440: 'initializing' : cannot convert from 'class SeqList<int> *' to 'int *'
while(n--)
*this++ = *srcptr++; // error C2105: '++' needs l-value
return *this;
}

//error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'int' (or there is no acceptable conversion)这个错误出在*this++ = *srcptr++; 请问上述三个错误如何处理,谢谢
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
spch2008
C++ 语言 65,214 成员 250,514 内容