由于此错误,我试图重载 + 运算符:
tools.cpp(147) : error C2679: binary '+' : no operator found 它采用'CSchemaString' 类型的右手操作数(或没有可接受的转换)
代码是:
// I TRIED THIS TO OVERLOAD + OPERATOR
CSchemaString operator +(const CVisuComm& CVisuComm::TabCCUImess,
const CSchemaString& GetPriority);
//THE CODE AT WHICH THE ERROR IS RETURNED,
//error C2679: binary '+' : no operator found which takes
//a right-hand operand of type
//'CSchemaString' (or there is no acceptable conversion)
CVisuComm::TabCCUImess[CVisuComm::nbCCUImess++]=
"RECONFIGURATION SOLUTION N° " +config.GetPriority();
//THE VARIOUS TYPES ARE
//CVisuComm-------class CVisuComm
//TabCCUImess-----static CString
//nbCCUImess------static int nbCCUImess
//config----------CConfig_State_ChangeType
//GetPriority-----CSchemaString
但它会引发同样的错误
错误 C2751:“CVisuComm::TabCCUImess”:无法限定函数参数的名称
所以请提出正确的方法来重载运算符。任何帮助表示赞赏。