2016-06-10 32 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;