
Gordon Woodhull wrote:
On Jul 9, 2011, at 10:41 AM, "Hartmut Kaiser" <hartmut.kaiser@gmail.com> wrote:
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.
E.g. 700 is different values in octal, decimal, hexadecimal.
On the current implementation if you try to convert "700" to an int you will get 700. If you want to take it as the representation of other than a decimal number you will need to use explicitly a specific library that provide it, as Boost.Coerce could do. If the Boost community consider that there is no good default behavior fro string to int conversion I will remove this specializations. Anyway, what is the result of coerce::as(*int*)("700"); ? Best, Vicente -- View this message in context: http://boost.2283326.n4.nabble.com/Boost-Conversion-pre-review-request-tp365... Sent from the Boost - Dev mailing list archive at Nabble.com.