diff options
author | lloyd <[email protected]> | 2010-06-11 14:00:39 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2010-06-11 14:00:39 +0000 |
commit | 098b27a426f32a0ade949f20a5115d720c6626f8 (patch) | |
tree | 112acc06dd841130b9f9ca0f41be29d1248f1e73 /checks | |
parent | cce4d165e5fbbd775da9704d18bb9ed094a8543f (diff) |
Work around GCC 3.x bug with reverse iterators
Diffstat (limited to 'checks')
-rw-r--r-- | checks/bench.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/checks/bench.cpp b/checks/bench.cpp index 70b8087d4..5a729a04f 100644 --- a/checks/bench.cpp +++ b/checks/bench.cpp @@ -145,8 +145,12 @@ void report_results(const std::string& algo, std::cout << algo; - for(std::map<double, std::string>::const_reverse_iterator i = results.rbegin(); - i != results.rend(); ++i) +#if defined(__GNUC__) && __GNUC__ <= 3 + // Work around GCC 3.x bug, reverse iterators don't work + for(std::map<double, std::string>::const_iterator i = results.begin(); i != results.end(); ++i) +#else + for(std::map<double, std::string>::const_reverse_iterator i = results.rbegin(); i != results.rend(); ++i) +#endif { std::cout << " [" << i->second << "] " << std::fixed << std::setprecision(2) << i->first; |