Boost logo

Boost :

From: Simon Buchan (simon_at_[hidden])
Date: 2005-10-25 22:01:59


David Abrahams wrote:
> "Andy Little" <andy_at_[hidden]> writes:
<snip>
>>>> integral constant can be converted to a
>>>> rational constant, but not necessarily the other way.
>>> Don't forget that the types are all known at compile-time. The usual
>>> runtime logic doesn't necessarily apply. A conversion from
>>> my_rational<x,1> to int_<x> is not a narrowing conversion.
>> Conversion is fine. Thats not what you said above.
>
> No, it's not what I said above. Remember, the usual runtime logic
> doesn't necessarily apply. my_rational<x,1> can be an integral
> constant *at compile time*. I'm not sure it's useful, but it's not
> insane.
>
If you for some reason still think this, why not eagerly evaluate
        template<typename Num>
        rational<Num,1>
to Num, since we are already eagerly normalising?

-- 
don't quote this

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