Boost logo

Boost :

From: Greg Chicares (chicares_at_[hidden])
Date: 2001-04-14 09:51:29


status/cs-win32.html says gcc fails the test in libs/timer/timer_test.cpp .

With these two patches, it works[1] with gcc-2.95.2-1[2]:

Patch one:

boost/timer.hpp
- #include <limits>
+ #include <boost/pending/limits.hpp>

I believe John Maddock already did this on 2001-04-01
and replaced boost/pending/limits.hpp with boost/limits.hpp .

Patch two:

boost/progress.hpp
  #include <iostream>
+ #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ <= 95
+ namespace std { class ios_base : public ios{}; }
+ #endif // defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ <= 95
  namespace boost {

Is this preferable to the workaround
  std::istream::fmtflags f_; // old GNU c++ lib has no ios_base
in random.hpp?

Either of these hacks could be put in a header /boost/iostream.hpp,
which could then be used in place of <iostream> throughout boost;
but I imagine that's objectionable for a single-compiler workaround.

Another option is to use either hack wherever ios_base is used:
  progress.hpp
  rational.hpp [already uses std::istream::fmtflags]
  libs/regex/src/cpp_regex_traits.cpp
I think that's the best way.

Leaving rational.hpp as it is and ignoring the other two files
that use ios_base is another option that doesn't seem good.

[1] I get
  t1 elapsed: 1.05
  t2 elapsed: 1.05
  t1 and t2 should report the same times (very approximately 2 seconds).
Is 1.05 close enough to 2? With borland C++ 5.5 I get
  t1 elapsed: 1.339
  t2 elapsed: 1.339

[2] The official gcc / win32 test platform seems to be cygwin;
I used the mingw32 port (www.mingw.org). Is there any interest
in reporting mingw32 test results as well in status/cs-win32.html?


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