std::cout et std::wstring
Bonjour,
Je souhaite afficher des wstring comme ceci:
Code:
1 2
| string coucou = "coucou";
cout <<"coucou : "<<coucou<<endl; |
J'obtiens l'erreur suivante à la compilation:
Code:
1 2
| error C2679: binary '<<' : no operator found which takes a right-hand operand
of type 'std::wstring' (or there is no acceptable conversion) |
Pourtant il esiste la méthode :
Code:
1 2 3 4 5
| template<class CharType, class Traits, class Allocator>
basic_ostream<CharType, Traits>& operator<<(
basic_ostream<CharType, Traits>& _Ostr,
const basic_string<CharType, Traits, Allocator>& _Str
); |
D'après vous, d'où vient le problème ?