Boost logo

Boost Users :

From: Balasubramanyam, Shivakumar (sbalasub_at_[hidden])
Date: 2008-04-02 19:18:56


Hi,

 

I need conversion from strings to integers. But the strings could also
be hex numbers.

 

So example is,

 

typedef unsigned long hexType;

 

hexType value;

 

lexical_cast<HexType>("0xAABBCCDD");

 

How do we extend the boost::lexical_cast to support casting user defined
types?

 

I can perform this by specialization but those would need to be in boost
namespace which does not seem to be a recommended way to add
customizations.

 

Thanks,

Shiva



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net