error: no match for 'operator=' in '*(xxxx*)n = t'
qList中使用自定义类型时,如果使用append函数需要重载 operator= 运算符
例如:
public:
CScpiExecuteCommand& operator=( const CScpiExecuteCommand &cmd )
{
xx = cmd.xx
return *this;
}
如果丢掉了 const 会出现 error: no match for 'operator=' in '*(scpi_parse::CScpiExecuteCommand*)n = t'错误
因为在qlist.h中会调用
Q_INLINE_TEMPLATE void QList<T>::node_construct(Node *n, const T &t)

浙公网安备 33010602011771号