升压使用boost :: lexical_cast的汇编UUID转换为字符串错误 [英] Boost compile error on converting UUID to string using boost::lexical_cast
本文介绍了升压使用boost :: lexical_cast的汇编UUID转换为字符串错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有是基于几个职位所以这code:
I have this code which is based on several posts in SO:
boost::uuids::uuid uuid = boost::uuids::random_generator()();
auto uuidString= boost::lexical_cast<std::string>(uuid);
但是当我编译这个code,我得到这个错误:
but when I am compiling this code, I am getting this error:
Source type is neither std::ostream`able nor std::wostream`able C:\Local\boost\boost\lexical_cast\detail\converter_lexical.hpp
如何解决这个问题?
How can I fix this error?
推荐答案
您错过了包括我猜:
<大骨节病> 住在Coliru 骨节病>
#include <boost/lexical_cast.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/random_generator.hpp>
int main() {
boost::uuids::uuid uuid = boost::uuids::random_generator()();
auto uuidString = boost::lexical_cast<std::string>(uuid);
}
这篇关于升压使用boost :: lexical_cast的汇编UUID转换为字符串错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文