默认参数只需在声明原型时使用,定义的时候就不需要了。
1>Code\DAO\MachineDAO.cpp(110): error C2572: “MachineInfoDAO::remove”: 重定义默认参数 : 参数 3
1> F:\RandV-S\RandV-S 8.01\Code/dao/MachineDAO.h(99) : 参见“MachineInfoDAO::remove”的声明
bool update(const QString machineID,const QString newStr,const int changeArea=1);
// Function: remove(reload3)
// Description: 通过(机器ID||机器名字)组合(模式Scale||机器模型号)2*2,删除数据库RV中的machine表的对应值.
// 当strItem2取默认值时,则以strItem1作为来删除相关记录,
bool MachineInfoDAO::remove(const QString strItem1,const QString strItem2,int d_type)
{
if (d_type>8 ||d_type < 1)
{
m_strErrMg = QString("传参错误:当参数3取值范围为1—8");
return false;
}
...
}