Qt编译错误:
/opt/apps/zrxsdk2023/nowin/wine/include/tchar.h:22: error: cannot bind non-const lvalue reference of type ‘CStdStr<wchar_t>&’ to an rvalue of type ‘CStdStr<wchar_t>’
22 | #define __T(x) L ## x
| ^
原因,在自定义的StdMapStringToString函数中,SetAt函数的第二个参数需要加上const,或者去掉引用;
//void SetAt(_Key key, _Tp &val)//错误,第二个参数不能加引用,因为它不修改,当第二个参数传递常量时出错,传递变量没错。
void SetAt(_Key key, _Tp val)
{
(*this)[key] = val;
}