Boost logo

Boost :

Subject: Re: [boost] [convert] are you mixing default_value and error_value?
From: Vladimir Batov (batov_at_[hidden])
Date: 2009-07-09 04:38:40

> 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?


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