Boost logo

Boost Users :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2006-03-29 11:19:30


David Abrahams wrote:
> "Fernando Cacciola" <fernando_cacciola_at_[hidden]> writes:
>
>> The default policy is to use the "internal range checking" logic,
>> which, if the source or target types are UDT, means no range
>> checking at all.
>>
>> But you can, however, create and pass your own range checking policy.
>> Is just that you can't simply use numeric_cast<> then.
>
> That's rather a shame. It would be better for generic code if the
> checking policy could be specified non-intrusively, e.g. via some
> traits.
>
I think I agree actually..
The choice of policies vs traits was deliverate, but at this point in time I
don't quite remember the rationale. All I recall was a heavy discussion
about it.

I was already thinking about the possible changes as I wrote this response,
and its on my TODO list now.
AFAICS, it won't be backward incompatible with the existing numeric_cast<>
becasue it will only add range checking iff the user defines the right
traits classes.

-- 
Fernando Cacciola
SciSoft
http://fcacciola.50webs.com/

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