Boost logo

Boost :

From: Moore, Paul (paul.moore_at_[hidden])
Date: 2000-06-23 08:33:52


From: David Abrahams [mailto:abrahams_at_[hidden]]
>
> I think you'd better describe the problem again. I don't
> recall seeing any error messages from you.

It was a bit buried in the running text. Here it is again...

<quote>
I've included a workaround for the mingw lack of <limits> in
rational_example.cpp, but mingw still breaks with

    boost\rational.hpp: In function `class boost::rational<int>
    boost::abs<int>(const boost::rational<int> &)':
    rational_example.cpp:65: instantiated from here
    boost\rational.hpp:311: no matching function for call to `abs (int)'
</quote>

Looks like it isn't picking up the abs(int) used by abs(rational). I include
<cstdlib>, and I do a using std::abs() (protected by a
BOOST_NO_STDC_NAMESPACE check), so int abs(int) should be visible AFAIUI.
But this stuff starts to feel like scary black magic to me every time I try
to get my head round it, so it could easily be something trivial.

Mind you, that abs() definition (template <typename IntType>
rational<IntType> abs (const rational<IntType> &)) is a template overload in
the boost namespace of a function (abs) which also has definitions in the
std namespace (and the global namespace, which is the same as std on
gcc...). Which is found by Koenig lookup, I think... So compiler bugs or
brain bugs are about equally likely...

Paul.


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