Boost logo

Boost :

Subject: Re: [boost] Boost.Conversion - pre review request
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-07-09 19:22:06


> > I don't see why we need to specify that the format is hexadecimal. I would
> > expect that the spirit grammar associated to the coerce library will take
> > care of all the formats without any specific additional tag.
>
> Doing implicit conversion from 0x17 to 'int' without explicit guidance from the user (i.e. by telling to convert from hex) is not a good idea, IMHO. I'd suggest to make the conversion explicit as much as possible, which usually amounts to the least surprised user.

Moreover, a user may want to convert a string like "054F3AB9C4E1"
to an integer without having to prefix it with "0x" (think of a
MAC address). In this case they need a way of specifying that
it's a hex number.
 
Regards,
Nate.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk