提问人:Madhu Rao 提问时间:1/19/2023 最后编辑:James ZMadhu Rao 更新时间:1/19/2023 访问量:55
显式删除的函数
Explicitly deleted functions
问:
我们正在将代码从旧代码迁移到 VS 2019
我们在运算符“<<”上有一个重载函数,它调用basic_ostream函数 执行以下行时。
CStringArray asLine;
using ostream = basic_ostream<char, char_traits<char>>;
ostream os;
os << (LPCTSTR)asLine[nLine2]; <---- this line is producing the C2280 error with message
"basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete"
这在旧版应用程序中起作用。如何克服这个问题?
请提出任何解决方法
CStringArray asLine; // class with set and get functions.
ostream os;
int nLine2 = 20; // nline has subscript valve to the asline[]
os << (LPCTSTR)asLine[nLine2];
答: 暂无答案
评论
basic_ostream<TCHAR>
MBCS
_MBCS
UNICODE
_UNICODE
TCHAR
char
wchar_t