aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--checks/bench.cpp8
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;