remove std_min and std_max, update minmax coding guidelines

[SVN r23162]
This commit is contained in:
Eric Niebler
2004-06-23 04:49:48 +00:00
parent d310bc9835
commit 8d994b14b2
7 changed files with 13 additions and 20 deletions

View File

@ -35,7 +35,6 @@ using std::getline;
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <boost/timer.hpp> #include <boost/timer.hpp>
#include <boost/smart_ptr.hpp> #include <boost/smart_ptr.hpp>
#include <boost/minmax.hpp>
#if (defined(_MSC_VER) && (_MSC_VER <= 1300)) || defined(__sgi) #if (defined(_MSC_VER) && (_MSC_VER <= 1300)) || defined(__sgi)
// maybe no Koenig lookup, use using declaration instead: // maybe no Koenig lookup, use using declaration instead:
@ -146,7 +145,7 @@ int main(int argc, char**argv)
double tim; double tim;
bool result; bool result;
int iters = 100; 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) while(true)
{ {

View File

@ -9,7 +9,6 @@
* *
*/ */
#include <boost/minmax.hpp>
#include "regex_comparison.hpp" #include "regex_comparison.hpp"
#include <boost/timer.hpp> #include <boost/timer.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
@ -46,7 +45,7 @@ double time_match(const std::string& re, const std::string& text, bool icase)
boost::regex_match(text, what, e); boost::regex_match(text, what, e);
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; 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); boost::regex_grep(&dummy_grep_proc, text, e);
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }

View File

@ -9,7 +9,6 @@
* *
*/ */
#include <boost/minmax.hpp>
#include "regex_comparison.hpp" #include "regex_comparison.hpp"
#if defined(BOOST_HAS_GRETA) #if defined(BOOST_HAS_GRETA)
#include <cassert> #include <cassert>
@ -49,7 +48,7 @@ double time_match(const std::string& re, const std::string& text, bool icase)
e.match(text, what); e.match(text, what);
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }
@ -95,7 +94,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase)
} }
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }

View File

@ -12,7 +12,6 @@
#include "regex_comparison.hpp" #include "regex_comparison.hpp"
#include <boost/timer.hpp> #include <boost/timer.hpp>
#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <boost/minmax.hpp>
namespace bl{ 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); boost::regex_match(text, what, e);
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; 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); boost::regex_grep(&dummy_grep_proc, text, e);
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }

View File

@ -11,7 +11,6 @@
#include <cassert> #include <cassert>
#include <cfloat> #include <cfloat>
#include <boost/minmax.hpp>
#include "regex_comparison.hpp" #include "regex_comparison.hpp"
#ifdef BOOST_HAS_PCRE #ifdef BOOST_HAS_PCRE
#include "pcre.h" #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)); erroffset = pcre_exec(ppcre, pe, text.c_str(), text.size(), 0, 0, what, sizeof(what)/sizeof(int));
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
free(ppcre); free(ppcre);
free(pe); free(pe);
@ -153,7 +152,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase)
} }
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }

View File

@ -11,7 +11,6 @@
#include <cassert> #include <cassert>
#include <cfloat> #include <cfloat>
#include <boost/minmax.hpp>
#include "regex_comparison.hpp" #include "regex_comparison.hpp"
#ifdef BOOST_HAS_POSIX #ifdef BOOST_HAS_POSIX
#include <boost/timer.hpp> #include <boost/timer.hpp>
@ -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); regexec(&e, text.c_str(), e.re_nsub, what, 0);
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
regfree(&e); regfree(&e);
return result / iter; return result / iter;
@ -117,7 +116,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase)
} }
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }

View File

@ -14,7 +14,6 @@
#include <cassert> #include <cassert>
#include <boost/timer.hpp> #include <boost/timer.hpp>
#include <boost/minmax.hpp>
#include "regexpr2.h" #include "regexpr2.h"
namespace gs{ namespace gs{
@ -50,7 +49,7 @@ double time_match(const std::string& re, const std::string& text, bool icase)
e.match(text, what); e.match(text, what);
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }
@ -97,7 +96,7 @@ double time_find_all(const std::string& re, const std::string& text, bool icase)
} }
} }
run = tim.elapsed(); run = tim.elapsed();
result = std_min(run, result); result = (std::min)(run, result);
} }
return result / iter; return result / iter;
} }