21 Dec
2001
21 Dec
'01
4:42 a.m.
On 12/20/01 1:32 PM, "rogeeff"
can I you lexical_cast to convert string "0x16" to 22?
Not without defining your own type to cast to. The behavior of lexical_cast is limited to what the stream input functions do by default. The operator>> for int will parse the "0" if presented with the string "0x16". On the other hand, there's nothing preventing you from using lexical_cast to cast to another type, in which case you can make it do anything you want, since it will call the operator>> overload for that type. -- Darin