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);
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?
You're missing the include, I guess:
Live On Coliru
You could try:
The Documentation states:
However the
lexical_cast
should work as well.Maybe you should check what
uuid
actually contains to figure out if there's something wrong with the generateduuid
.Also:
should be slightly faster according to the doc.