msvc なら
std::wcout.imbue( std::locale("japanese") );
gccなら
::setlocale( LC_ALL, "ja_JP.utf-8" );
をoperator<<を使う前に実行すればできたようなできなかったような