From 8d994b14b28fc7ee2e9197456ca5315ef421838d Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Wed, 23 Jun 2004 04:49:48 +0000 Subject: [PATCH] remove std_min and std_max, update minmax coding guidelines [SVN r23162] --- example/timer/regex_timer.cpp | 3 +-- performance/time_boost.cpp | 5 ++--- performance/time_greta.cpp | 5 ++--- performance/time_localised_boost.cpp | 5 ++--- performance/time_pcre.cpp | 5 ++--- performance/time_posix.cpp | 5 ++--- performance/time_safe_greta.cpp | 5 ++--- 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/example/timer/regex_timer.cpp b/example/timer/regex_timer.cpp index 5392665e..67484858 100644 --- a/example/timer/regex_timer.cpp +++ b/example/timer/regex_timer.cpp @@ -35,7 +35,6 @@ using std::getline; #include #include #include -#include #if (defined(_MSC_VER) && (_MSC_VER <= 1300)) || defined(__sgi) // maybe no Koenig lookup, use using declaration instead: @@ -146,7 +145,7 @@ int main(int argc, char**argv) double tim; bool result; int iters = 100; - double wait_time = boost::std_min(t.elapsed_min() * 1000, 1.0); + double wait_time = (std::min)(t.elapsed_min() * 1000, 1.0); while(true) { diff --git a/performance/time_boost.cpp b/performance/time_boost.cpp index b030c69a..ea80ded5 100644 --- a/performance/time_boost.cpp +++ b/performance/time_boost.cpp @@ -9,7 +9,6 @@ * */ -#include #include "regex_comparison.hpp" #include #include @@ -46,7 +45,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) boost::regex_match(text, what, e); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } @@ -87,7 +86,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) boost::regex_grep(&dummy_grep_proc, text, e); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } diff --git a/performance/time_greta.cpp b/performance/time_greta.cpp index 6f08c2d8..15c9be40 100644 --- a/performance/time_greta.cpp +++ b/performance/time_greta.cpp @@ -9,7 +9,6 @@ * */ -#include #include "regex_comparison.hpp" #if defined(BOOST_HAS_GRETA) #include @@ -49,7 +48,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) e.match(text, what); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } @@ -95,7 +94,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } diff --git a/performance/time_localised_boost.cpp b/performance/time_localised_boost.cpp index 56bff664..e3276c59 100644 --- a/performance/time_localised_boost.cpp +++ b/performance/time_localised_boost.cpp @@ -12,7 +12,6 @@ #include "regex_comparison.hpp" #include #include -#include namespace bl{ @@ -46,7 +45,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) boost::regex_match(text, what, e); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } @@ -87,7 +86,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) boost::regex_grep(&dummy_grep_proc, text, e); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } diff --git a/performance/time_pcre.cpp b/performance/time_pcre.cpp index 95603412..8aee6d98 100644 --- a/performance/time_pcre.cpp +++ b/performance/time_pcre.cpp @@ -11,7 +11,6 @@ #include #include -#include #include "regex_comparison.hpp" #ifdef BOOST_HAS_PCRE #include "pcre.h" @@ -70,7 +69,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) erroffset = pcre_exec(ppcre, pe, text.c_str(), text.size(), 0, 0, what, sizeof(what)/sizeof(int)); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } free(ppcre); free(pe); @@ -153,7 +152,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } diff --git a/performance/time_posix.cpp b/performance/time_posix.cpp index 75504ba0..4bf19b5b 100644 --- a/performance/time_posix.cpp +++ b/performance/time_posix.cpp @@ -11,7 +11,6 @@ #include #include -#include #include "regex_comparison.hpp" #ifdef BOOST_HAS_POSIX #include @@ -51,7 +50,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) regexec(&e, text.c_str(), e.re_nsub, what, 0); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } regfree(&e); return result / iter; @@ -117,7 +116,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } diff --git a/performance/time_safe_greta.cpp b/performance/time_safe_greta.cpp index 64664cb3..8ef4b4d2 100644 --- a/performance/time_safe_greta.cpp +++ b/performance/time_safe_greta.cpp @@ -14,7 +14,6 @@ #include #include -#include #include "regexpr2.h" namespace gs{ @@ -50,7 +49,7 @@ double time_match(const std::string& re, const std::string& text, bool icase) e.match(text, what); } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; } @@ -97,7 +96,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase) } } run = tim.elapsed(); - result = std_min(run, result); + result = (std::min)(run, result); } return result / iter; }