Boost logo

Boost Users :

Subject: [Boost-users] boost::lexical_cast<> with hex strings?
From: anony (janezz55_at_[hidden])
Date: 2010-07-15 03:09:01

I'd like to do something like:

boost::uint16_t b(std::lexical_cast<boost::uint16_t>("xa"));

I have no control of the string stream that lexical_cast uses
internally, so how could I implement this?

P.S.: There are a lot of false statements made about this functionality
on the web, some people claim that boost::lexical_cast<> can do the
conversion out of the box, but this is not so in my tests.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at