Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-03 14:13:07


The Intel compiler is having some problems with rational.hpp which are
showing up when I try to compile the Python library. Subtraction of two
rationals is trying to go through this function instead of using the one
generated by the subtractable<> template:

// Reversed order operators for - and / between IntType and rational
template <typename IntType, typename T>
inline rational<IntType>
operator- (T i, const rational<IntType>& r)
{
    IntType ii = i; // Must be able to implicitly convert T -> IntType
    return rational<IntType>(ii) -= r;
}

It seems to me that the compiler is probably in error here, but all the
same, I'm curious as to why we're not using IntType as one of the
parameters, rather than using a free T parameter. Can somebody fill me in?

Thanks,
Dave


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