Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2008-03-11 09:51:15


Author: dgregor
Date: 2008-03-11 09:51:15 EDT (Tue, 11 Mar 2008)
New Revision: 43561
URL: http://svn.boost.org/trac/boost/changeset/43561

Log:
Simplify min, max, and minmax based on some feedback from Sylvain Pion
Text files modified:
   sandbox/committee/concepts/stdlib/clib-algorithms.tex | 22 ++++++++++++++--------
   1 files changed, 14 insertions(+), 8 deletions(-)

Modified: sandbox/committee/concepts/stdlib/clib-algorithms.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-algorithms.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-algorithms.tex 2008-03-11 09:51:15 EDT (Tue, 11 Mar 2008)
@@ -661,8 +661,9 @@
   @\textcolor{black}{// \ref{alg.min.max}, minimum and maximum:}@
   template<LessThanComparable T> const T& min(const T& @\farg{a}@, const T& @\farg{b}@);
   template<class T, Predicate<auto, T, T> Compare>
+ @\addedCC{requires !SameType<T, Compare>}@
     const T& min(const T& @\farg{a}@, const T& @\farg{b}@, Compare @\farg{comp}@);
- @\addedCC{template<LessThanComparable T> const T\& min(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
+ @\removedCC{template<LessThanComparable T> const T\& min(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
   @\addedCC{template<LessThanComparable T, LessThanComparable... Args>}@
     @\addedCC{requires SameType<T, Args>...}@
     @\addedCC{const T\& min(const T\& \mbox{\farg{a}}, const Args\&... \mbox{\farg{args}});}@
@@ -671,8 +672,9 @@
 
   template<LessThanComparable T> const T& max(const T& @\farg{a}@, const T& @\farg{b}@);
   template<class T, Predicate<auto, T, T> Compare>
+ @\addedCC{requires !SameType<T, Compare>}@
     const T& max(const T& @\farg{a}@, const T& @\farg{b}@, Compare @\farg{comp}@);
- @\addedCC{template<LessThanComparable T> const T\& max(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
+ @\removedCC{template<LessThanComparable T> const T\& max(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
   @\addedCC{template<LessThanComparable T, LessThanComparable... Args>}@
     @\addedCC{requires SameType<T, Args>...}@
     @\addedCC{const T\& max(const T\& \mbox{\farg{a}}, const Args\&... \mbox{\farg{args}});}@
@@ -681,9 +683,10 @@
 
   template<LessThanComparable T> pair<const T&, const T&> minmax(const T& @\farg{a}@, const T& @\farg{b}@);
   template<class T, Predicate<auto, T, T> Compare>
+ @\addedCC{requires !SameType<T, Compare>}@
     pair<const T&, const T&> minmax(const T& @\farg{a}@, const T& @\farg{b}@, Compare @\farg{comp}@);
- @\addedCC{template<LessThanComparable T>}@
- @\addedCC{pair<const T\&, const T\&> minmax(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
+ @\removedCC{template<LessThanComparable T>}@
+ @\removedCC{pair<const T\&, const T\&> minmax(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
   @\addedCC{template<LessThanComparable T, LessThanComparable... Args>}@
     @\addedCC{requires SameType<T, Args>...}@
     @\addedCC{pair<const T\&, const T\&> minmax(const T\& \mbox{\farg{a}}, const Args\&... \mbox{\farg{args}});}@
@@ -3575,6 +3578,7 @@
 \color{addclr}\begin{itemdecl}
 template<LessThanComparable T> const T& min(const T& @\farg{a}@, const T& @\farg{b}@);
 template<class T, Predicate<auto, T, T> Compare>
+ @\addedCC{requires !SameType<T, Compare>}@
   const T& min(const T& @\farg{a}@, const T& @\farg{b}@, Compare @\farg{comp}@);
 \end{itemdecl}\color{black}
 
@@ -3596,7 +3600,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-@\addedCC{template<LessThanComparable T> const T\& min(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
+@\removedCC{template<LessThanComparable T> const T\& min(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
 @\addedCC{template<LessThanComparable T, LessThanComparable... Args>}@
   @\addedCC{requires SameType<T, Args>...}@
   @\addedCC{const T\& min(const T\& \mbox{\farg{a}}, const Args\&... \mbox{\farg{args}});}@
@@ -3655,6 +3659,7 @@
 \color{addclr}\begin{itemdecl}
 template<LessThanComparable T> const T& max(const T& @\farg{a}@, const T& @\farg{b}@);
 template<class T, Predicate<auto, T, T> Compare>
+ @\addedCC{requires !SameType<T, Compare>}@
   const T& max(const T& @\farg{a}@, const T& @\farg{b}@, Compare @\farg{comp}@);
 \end{itemdecl}\color{black}
 
@@ -3676,7 +3681,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-@\addedCC{template<LessThanComparable T> const T\& max(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
+@\removedCC{template<LessThanComparable T> const T\& max(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
 @\addedCC{template<LessThanComparable T, LessThanComparable... Args>}@
   @\addedCC{requires SameType<T, Args>...}@
   @\addedCC{const T\& max(const T\& \mbox{\farg{a}}, const Args\&... \mbox{\farg{args}});}@
@@ -3730,6 +3735,7 @@
 \begin{itemdecl}
 template<LessThanComparable T> pair<const T&, const T&> minmax(const T& @\farg{a}@, const T& @\farg{b}@);
 template<class T, Predicate<auto, T, T> Compare>
+ @\addedCC{requires !SameType<T, Compare>}@
   @\textcolor{addclr}{pair}@<const T&, const T&> minmax(const T& @\farg{a}@, const T& @\farg{b}@, Compare @\farg{comp}@);
 \end{itemdecl}
 \color{black}
@@ -3758,8 +3764,8 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-@\addedCC{template<LessThanComparable T>}@
- @\addedCC{pair<const T\&, const T\&> minmax(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
+@\removedCC{template<LessThanComparable T>}@
+ @\removedCC{pair<const T\&, const T\&> minmax(const T\& \mbox{\farg{a}}, const T\& \mbox{\farg{b}}, const T\& \mbox{\farg{c}});}@
 @\addedCC{template<LessThanComparable T, LessThanComparable... Args>}@
   @\addedCC{requires SameType<T, Args>...}@
   @\addedCC{pair<const T\&, const T\&> minmax(const T\& \mbox{\farg{a}}, const Args\&... \mbox{\farg{args}});}@


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk