Boost logo

Boost :

From: Paul Moore (gustav_at_[hidden])
Date: 2001-01-13 15:50:44


On 12 Jan 2001, at 20:25, Stephen Silver wrote:
> But then someone will use a value that doesn't fit in a long (e.g., an
> unsigned long, or a larger non-standard type) and it will be converted
> to an int (or a long), with the wrong result. I think all types that
> are implicitly convertible to IntType ought to be implicitly convertible
> to rational<IntType> as a matter of principle, and a template is the
> only way to do that.

In practical terms, I can't imagine a program using two different
"integer-like" user defined types which are interconvertible. So in a
real program, the only types which exist which are likely to be
convertible to IntType are the builtin ones. Excluding such things
as long long (not universally supported) and non-standard types
like _int64, a conversion from long should cover it.

Or should it? What about unsigned long? This may actually be
more of a can of worms than it seems at first glance...

Paul.


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