Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-01-24 14:14:56


Gabriel Dos Reis wrote:
> That is not true. I've just tested the following with 2.95.2 (and I
> believe it to work properly with the whole 2.95.x series.

> I'am mainly concerned with your comment about std::abs. It was not
> accurate.

It was. Note that rational<T> is a template class. Please try the
following test.

namespace N1
{
  int f(int);
}

template<class T>
int g(const T& x)
{
  using N1::f;
  return f(x);
}

int main()
{
  g(1);
}

The gcc error message on my Linux/x86 system is:

GNU C++ version 2.95.2 19991024 (release) (i686-pc-linux-gnu) compiled by GNU C version 2.95.2 19991024 (release).
using-decl2.cc: In function `int g<int>(const int &)':
using-decl2.cc:16: instantiated from here
using-decl2.cc:11: `f' undeclared (first use this function)
using-decl2.cc:11: (Each undeclared identifier is reported only once
using-decl2.cc:11: for each function it appears in.)

(The code compiles without a problem with Comeau C++ 4.2.44beta3 in strict mode.)

The bug was confirmed by Martin v. Loewis, one of the gcc authors.

I've also added slightly more verbiage to boost/rational.hpp.

Jens Maurer


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