Explicitly deleted functions

66 Views Asked by At

we are migrating code to VS 2019 from legacy code

We have an overloaded function on operator '<<' that is invoking basic_ostream function when executing the following lines.

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"

This was working in legacy application. how to overcome this issue?

please suggest any workaround

CStringArray asLine; // class with set and get functions.
ostream os;
int nLine2 = 20; // nline has subscript valve to the asline[]

os << (LPCTSTR)asLine[nLine2];

        
0

There are 0 best solutions below