0
私はこの試みた:どのようにCAtlStringWを昇順形式で使用しますか?
#include <iostream>
#include <boost\format.hpp>
#include <atlstr.h>
std::ostream& operator<<(std::ostream& os, const ATL::CAtlStringW& string)
{
return os << string.GetString();
}
int _tmain(int argc, _TCHAR* argv[])
{
CAtlStringW world = L"world";
boost::wformat formatter(L"hello %s");
formatter % world;
std::wstring formatted = formatter.str();
return 0;
}
、フォーマットは "ハロー004B54D8" として終わったが、私はそれは、 "Hello World" のようにしたいと思います。 私は演算子を名前空間内に定義するのと同じようなバリエーションを試しました。< <私は何が欠けていますか?オペレータ< <は呼び出されないようです。
ありがとうございました。 http://www.boost.org/doc/libs/1_49_0/libs/format/example/sample_userType.cpp