Boost logo

Boost :

Subject: Re: [boost] [convert] are you mixing default_value and error_value?
From: Vicente Botet Escriba (vicente.botet_at_[hidden])
Date: 2009-07-09 06:24:22

Vladimir Batov wrote:
>> From: "Vicente Botet Escriba" <vicente.botet_at_[hidden]>
>> ...
>>> Do we need to give an initial value just for conversion to work at
>>> all, or is it only needed as a return in the error case?
>>> Tony
>> It is needed for both usages: the initial value when the class is not
>> default constructible, and the error value when we want this value to be
>> returned when failure. Now we can not have an exception for the
>> conversion
>> to a class that is not default constructible because when we give a
>> default
>> value it is also interpreted as the error value. As I said we are mixing
>> both concepts, which is not good, as both are orthogonal.
> The is only *one* value provided -- a conversion-failure value. It happens
> to be used internally for some initialization (for std::stream-based
> conversions). It's an internal implementation matter and not guaranteed to
> be that way. What do we achieve by stressing it out?
> V.
> _______________________________________________
> Unsubscribe & other changes:


What does this does?

direction d = convert<direction>::from(str);


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at