
David Abrahams wrote:
"Andy Little" <andy@servocomm.freeserve.co.uk> 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