I have the following code:
/** Stupidly copies unicode chars into normal chars. */
std::string wstring2string(__in const std::wstring& s)
{
std::string temp(s.length(), ' ');
#pragma warning(push)
#pragma warning(disable: 4244) // possible loss of data
std::copy(s.begin(), s.end(), temp.begin());
#pragma warning(pop)
return temp;
}
My compiler still shows me warning C4244:
1>c:program filesmicrosoft visual studio 10.0vcincludexutility(2144): warning C4244: '=': Konvertierung von 'const wchar_t' in 'char', m?glicher Datenverlust
1> c:program filesmicrosoft visual studio 10.0vcincludexutility(2165): Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "_OutIt std::_Copy_impl<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::_Nonscalar_ptr_iterator_tag)".
(in English: "Conversion of const wchar_t
to char
, possible loss of data, see reference to instantiation of the just compiled function template …").
How can I disable it?!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…