2016-06-10 57 views
0

我有一個異常類定義如下wstring的轉換如下:無法從與升壓格式()

(unsigned short vendorID, unsigned short productID, std::wstring serialNumber) 

但是,這會導致以下編譯錯誤:

error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::wstring' (or there is no acceptable conversion) 

難道是我還是Boost格式化程序不能在wstring類型上工作?

回答

2

對寬字符串使用boost::wformat。請參閱文檔here

注意的typedef:

typedef basic_format<wchar_t > wformat;