Boost logo

Boost Users :

From: rogeeff (rogeeff_at_[hidden])
Date: 2001-12-21 13:12:40


--- In Boost-Users_at_y..., Darin Adler <darin_at_b...> wrote:
> On 12/20/01 1:32 PM, "rogeeff" <rogeeff_at_m...> wrote:
>
> > 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.

This solution I found either. But thank you anyway.

>
> -- Darin

Gennadiy.


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