Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-09-17 10:28:31


From: "michael toksvig" <michaeltoksvig_at_[hidden]>
>
> a counter-question, rob: how would you handle the addition of 2 numbers
> between 90 and 100, in your model?
>
> there are no possible outputs (180-200) within the input range (90-100). if,
> as i believe you suggest, the output range must match the input range, you
> would have to cast the inputs to match the output range. but the input and
> output ranges are disjunct

I concede. That case is compelling. If the library user tries
to put the result in a 90-100 range object, it will fail to
compile because there's no way for that to work.

Note that if the destination type can possibly hold the result,
then the check has to wait for run time.

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

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