Boost logo

Boost-Commit :

From: dgregor_at_[hidden]
Date: 2008-03-16 17:58:40


Author: dgregor
Date: 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
New Revision: 43658
URL: http://svn.boost.org/trac/boost/changeset/43658

Log:
Updated most of the documents for the Post-Bellevue mailing
Text files modified:
   sandbox/committee/concepts/issues/issues/issue1.xml | 8 +
   sandbox/committee/concepts/issues/issues/issue19.xml | 40 ++++++++++
   sandbox/committee/concepts/issues/issues/issue2.xml | 6 +
   sandbox/committee/concepts/issues/issues/issue22.xml | 13 ++
   sandbox/committee/concepts/issues/issues/issue23.xml | 18 +++-
   sandbox/committee/concepts/issues/issues/issue25.xml | 63 +++++++++++++++
   sandbox/committee/concepts/issues/issues/issue26.xml | 2
   sandbox/committee/concepts/issues/issues/issue3.xml | 20 ++++-
   sandbox/committee/concepts/issues/issues/issue5.xml | 6 +
   sandbox/committee/concepts/issues/issues/issue7.xml | 5 +
   sandbox/committee/concepts/stdlib/clib-algorithms.tex | 104 +++++++++++++-------------
   sandbox/committee/concepts/stdlib/clib-concepts.tex | 156 +++++++++++++++++++++------------------
   sandbox/committee/concepts/stdlib/clib-iterators.tex | 121 ++++++++++++++++--------------
   13 files changed, 361 insertions(+), 201 deletions(-)

Modified: sandbox/committee/concepts/issues/issues/issue1.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue1.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue1.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="1" status="Ready">
+<issue num="1" status="WP">
   <title>Naming and symmetry in EqualityComparable</title>
   <section><sref ref="[concept.comparison]"/></section>
   <submitter>LWG</submitter>
@@ -93,8 +93,10 @@
 }
     </pre>
 <ol>
- <li>&nbsp;&nbsp;&nbsp;&nbsp;<del><i>Note</i>: describes types whose
- values can be ordered via an inequality operator.</del></li>
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<i>Note</i>: describes types whose
+ values can be ordered<del> via an inequality operator</del><ins>, where <code>operator&lt;</code> is a strict weak ordering relation ([alg.sorting])</ins>.</li>
+
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<del><i>Requires</i>: <code>operator&lt;</code> is a strict weak ordering relation ([alg.sorting]).</del></li>
 </ol>
 </p>
 

Modified: sandbox/committee/concepts/issues/issues/issue19.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue19.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue19.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="19" status="New">
+<issue num="19" status="WP">
 <title>IteratorBase is an implementation detail</title>
 <section><sref ref="[iterator.concepts]"/></section>
 <submitter>LWG</submitter>
@@ -21,4 +21,42 @@
   </p>
 </discussion>
 
+<resolution>
+ <p>In [iterator.concepts], remove the <code>IteratorBase</code>
+ concept from the synopsis (in paragraph 1) and from paragraph 2.</p>
+
+ <p>In [input.iterators], change the <code>InputIterator</code>
+ concept as follows:</p>
+ <pre>
+concept InputIterator&lt;typename X&gt; : <del>IteratorBase&lt;X&gt;, </del>Semiregular&lt;X&gt;, EqualityComparable&lt;X&gt; {
+ <ins>typename value_type = typename X::value_type;</ins>
+ <ins>MoveConstructible reference = typename X::reference;</ins>
+ <ins>MoveConstructible pointer = typename X::pointer;</ins>
+
+ // ...
+}
+ </pre>
+
+ <p>In [output.iterators], change
+ the <code>BasicOutputIterator</code> concept as follows:</p>
+ <pre>
+concept BasicOutputIterator&lt;typename X&gt; : <del>IteratorBase&lt;X&gt;, </del>CopyConstructible&lt;X&gt; {
+ <ins>typename value_type = typename X::value_type;</ins>
+ <ins>MoveConstructible reference = typename X::reference;</ins>
+
+ // ...
+}
+ </pre>
+
+ <p>In [forward.iterators], modify
+ the <code>MutableForwardIterator</code> concept definition as
+ follows:</p>
+ <pre>
+concept MutableForwardIterator&lt;typename X&gt; : ForwardIterator&lt;X&gt;, BasicOutputIterator&lt;X&gt; {
+ <ins>requires SameType&lt;ForwardIterator&lt;X&gt;::value_type, BasicOutputIterator&lt;X&gt;::value_type&gt; &amp;&amp;
+ SameType&lt;ForwardIterator&lt;X&gt;::reference, BasicOutputIterator&lt;X&gt;::reference&gt;;</ins>
+}
+ </pre>
+</resolution>
+
 </issue>

Modified: sandbox/committee/concepts/issues/issues/issue2.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue2.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue2.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="2" status="New">
+<issue num="2" status="Open">
 <title>Requires clause for Destructible is unclear</title>
 <section><sref ref="[concept.destruct]"/></section>
 <submitter>LWG</submitter>
@@ -19,6 +19,10 @@
   as the target of a pseudo destructor call, or something like
   that. If we do believe that this is a purely syntactic construct
   then we might want to consider renaming it as HasDestructor.</p>
+
+ <p><b>Doug Gregor</b>: the requirements on the destructor come
+ directly from the corresponding table in the pre-concepts Working
+ Paper, so this issue wasn't introduced by concepts.</p>
 </discussion>
 
 </issue>

Modified: sandbox/committee/concepts/issues/issues/issue22.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue22.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue22.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="22" status="New">
+<issue num="22" status="WP">
   <title>Oddly-placed and missing <tt>InputIterator</tt> requirements</title>
 <section><sref ref="[input.iterators]"/></section>
 <submitter>LWG</submitter>
@@ -27,7 +27,14 @@
 </discussion>
 
 <resolution>
- <p>
- </p>
+ <p>Add the following at the beginning of [input.iterators]p8:</p>
+ <pre>
+bool operator==(X const&amp; a, X const&amp; b); // inherited from EqualityComparable&lt;X&gt;
+ </pre>
+
+ <p>Change [input.iterators]p12 as follows:</p>
+ <ol start="12">
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<i>Effects</i>: <del><code>++r</code></del><ins>equivalent to <code>{ T tmp = *r; ++r; return tmp; }</code></ins></li>
+ </ol>
 </resolution>
 </issue>

Modified: sandbox/committee/concepts/issues/issues/issue23.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue23.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue23.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="23" status="New">
+<issue num="23" status="Open">
 <title>Output iterators without value types</title>
 <section><sref ref="[output.iterators]"/></section>
 <submitter>LWG</submitter>
@@ -27,10 +27,18 @@
   and either getting rid of the concept that n2500
   calls <tt>OutputIterator</tt> or renaming it
   to <tt>BackwardCompatibilityOutputIteratorWithoutValueType</tt>.</p>
+
+ <p><b>Doug Gregor</b>: Note that the output iterator without a value
+ type (currently called <code>OutputIterator</code>) is used by many
+ of the algorithms in chapter 25. In fact, none of these algorithms
+ use <code>BasicOutputIterator</code> (the one that has a value
+ type). It would be a shame for all of our algorithms to have a name
+ like <code>BackwardCompatibilityOutputIteratorWithoutValueType</code>
+ in their requires clauses. Changing these algorithms to use the
+ output iterator with a value type (currently
+ called <code>BasicOutputIterator</code>) would break backward
+ compatibility significantly, and is therefore probably not
+ feasible.</p>
 </discussion>
 
-<resolution>
- <p>
- </p>
-</resolution>
 </issue>

Modified: sandbox/committee/concepts/issues/issues/issue25.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue25.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue25.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="25" status="New">
+<issue num="25" status="WP">
   <title>Lost normative semantics of <tt>ForwardIterator</tt></title>
 <section><sref ref="[forward.iterators]"/></section>
 <submitter>LWG</submitter>
@@ -21,7 +21,7 @@
   for the axiom feature.</p>
 
   <p>One of the other important axioms for forward iterators is
- that <tt>a == b</tt> iff <tt>a</tt> and <tt>b</tt> are the same
+ that <tt>a == b</tt> iff <tt>*a</tt> and <tt>*b</tt> are the same
   object. This axiom got moved to input iterators (but not using the
   axiom feature), where it does not belong. That assertion is not true
   for input iterators in general, or for some of the specific input
@@ -30,4 +30,63 @@
   specific memory location.</p>
 </discussion>
 
+<resolution>
+ <p>In [forward.iterators], add the following new paragraph:</p>
+ <pre>
+ <ins>X::X(); <i>// inherited from Regular&lt;X&gt;</i></ins>
+ </pre>
+
+ <ol>
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<ins><i>Note</i>: the constructed
+ object might have a singular value.</ins></li>
+ </ol>
+
+ <p>In [input.iterators], remove paragraph 9:</p>
+ <ol start="9">
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<del>If two iterators <code>a</code> and <code>b</code> of the
+ same type are both dereferenceable, then <code>a == b</code> if and only if <code>*a</code> and
+ <code>*b</code> are the same object.</del></li>
+ </ol>
+
+ <p>In [forward.iterators], add the following axiom to the definition
+ of the <code>ForwardIterator</code> concept:</p>
+ <pre>
+ <ins>axiom MultiPass(X a, X b) {
+ if (a == b) *a == *b;
+ if (a == b) ++a == ++b;
+ &amp;a == &amp;++a;
+ }</ins>
+ </pre>
+
+ <p>Add the following paragraph to [forward.iterators]:</p>
+ <pre>
+ <ins>reference operator*(X&amp;);</ins>
+ <ins>reference operator*(X const&amp;);</ins>
+ </pre>
+ <ol start="2">
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<ins><i>Requires</i>: If two iterators
+ <code>a</code> and <code>b</code> of the same type are both
+ dereferenceable, then <code>a == b</code> if and only
+ if <code>*a</code> and <code>*b</code> are the same
+ object.</ins></li>
+ </ol>
+
+ <p>In [bidirectional.iterators], add the following axiom to
+ the <code>Bidireciotnal</code> iterator concept:
+ <pre>
+ <ins>axiom BackwardTraversal(X a, X b) {
+ --(++a) == a;
+ if (--a == --b) a == b;
+ &amp;a == &amp;--a;
+ }</ins>
+ </pre>
+ and remove paragraph 5:</p>
+ <ol start="5">
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<del><i>Effects</i>: <code>--(++r) == r</code>.<br/>
+ <code>--r == --s</code> implies <code>r == s</code>.<br/>
+ <code>&amp;r == &amp;--r</code>.</del></li>
+ </ol>
+
+</resolution>
+
 </issue>

Modified: sandbox/committee/concepts/issues/issues/issue26.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue26.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue26.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="26" status="Ready">
+<issue num="26" status="Open">
 <title>Transition of Clause 17, Library introduction</title>
 <section><sref ref="[library]"/></section>
 <submitter>Beman Dawes</submitter>

Modified: sandbox/committee/concepts/issues/issues/issue3.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue3.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue3.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="3" status="New">
+<issue num="3" status="WP">
 <title>Naming of Constructible/DefaultConstructible concepts</title>
 <section><sref ref="[concept.construct]"/></section>
 <submitter>LWG</submitter>
@@ -12,12 +12,24 @@
 <discussion>
   <p><tt>Constructible</tt> and <tt>DefaultConstructible</tt> don't
   have any semantics, so they should have the prefix <tt>Has</tt>.</p>
+
+ <p>Doug Gregor: <tt>DefaultConstructible</tt> does have some
+ (admittedly weak) semantics regarding what it does, and the name
+ itself is part of the vocabulary of generic programming, so I
+ suggest we keep it. </p>
 </discussion>
 
 <resolution>
- <p>Rename <tt>Constructible</tt> to <tt>HasConstructor</tt>,
- and rename <tt>DefaultConstructible</tt> to
- <tt>HasDefaultConstructor</tt></p>
+ <p>Rename <tt>Constructible</tt> to <tt>HasConstructor</tt>. </p>
+
+ <p>In [concept.construct], change paragraph 2 as follows:
+ <ol start="2">
+ <li>&nbsp;&nbsp;&nbsp;&nbsp;<i>Note</i>: describes
+ types <del>that can be default-constructed</del><ins>for which
+ an object can be constructed without initializing the object
+ to any particular value</ins>.</li>
+ </ol>
+ </p>
 </resolution>
 
 </issue>

Modified: sandbox/committee/concepts/issues/issues/issue5.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue5.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue5.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="5" status="New">
+<issue num="5" status="Open">
 <title>Inconsistent naming between concepts and type traits</title>
 <section><sref ref="[utility.concepts]"/></section>
 <submitter>LWG</submitter>
@@ -22,7 +22,9 @@
 </discussion>
 
 <resolution>
- <p>The table provides the proposed mapping between type traits and concepts.</p>
+ <p>The table provides the mapping between type traits and
+ concepts. Any <ins>insertions</ins> or <del>deletions</del> indicate
+ changes proposed as part of this issue.</p>
   <table border="1">
     <tr>
       <th bgcolor="#ffffcc">Type trait</th>

Modified: sandbox/committee/concepts/issues/issues/issue7.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue7.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue7.xml 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -19,5 +19,10 @@
     for the same type it should be defined in terms
     of <tt>operator==</tt>, but this concept doesn't mention that
     operator.)</p>
+
+ <p><b>Doug Gregor</b>: the requirements on the move-assignment
+ operator come directly from the corresponding table in the
+ pre-concepts Working Paper, so this issue wasn't introduced by
+ concepts.</p>
 </discussion>
 </issue>

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-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -42,7 +42,7 @@
 \end{center}
 
 \vspace{1in}
-\par\noindent Document number: D2573=08-0083\vspace{-6pt}
+\par\noindent Document number: N2573=08-0083\vspace{-6pt}
 \par\noindent Revises document number: N2084=06-0154\vspace{-6pt}
 \par\noindent Date: \today\vspace{-6pt}
 \par\noindent Project: Programming Language \Cpp{}, Library Working Group\vspace{-6pt}
@@ -119,12 +119,12 @@
   template<InputIterator Iter, Callable<auto, Iter::reference> Function>
     Function for_each(Iter @\farg{first}@, Iter @\farg{last}@, Function @\farg{f}@);
   template<InputIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T>
     Iter find(Iter @\farg{first}@, Iter @\farg{last}@, const T& @\farg{value}@);
   template<InputIterator Iter, Predicate<auto, Iter::reference> Pred>
     Iter find_if(Iter @\farg{first}@, Iter @\farg{last}@, Pred @\farg{pred}@);
   template<ForwardIterator Iter1, ForwardIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
     Iter1 find_end(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                    Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
   template<ForwardIterator Iter1, ForwardIterator Iter2,
@@ -134,7 +134,7 @@
                    Pred @\farg{pred}@);
 
   template<InputIterator Iter1, ForwardIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
     Iter1 find_first_of(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                         Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
   template<InputIterator Iter1, ForwardIterator Iter2,
@@ -150,13 +150,13 @@
     Iter adjacent_find(Iter @\farg{first}@, Iter @\farg{last}@, Pred @\farg{pred}@);
 
   template<InputIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T>
     @\color{addclr}@Iter::difference_type count(Iter @\farg{first}@, Iter @\farg{last}@, const T& @\farg{value}@);
   template<InputIterator Iter, Predicate<auto, Iter::reference> Pred>
     Iter::difference_type count_if(Iter @\farg{first}@, Iter @\farg{last}@, Pred @\farg{pred}@);
 
   template<InputIterator Iter1, InputIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
     pair<Iter1, Iter2> mismatch(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                                 Iter @\farg{first2}@);
   template<InputIterator Iter1, InputIterator Iter2,
@@ -165,7 +165,7 @@
                                 Iter2 @\farg{first2}@, Pred @\farg{pred}@);
 
   template<InputIterator Iter1, InputIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
     bool equal(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                Iter2 @\farg{first2}@);
   template<InputIterator Iter1, InputIterator Iter2,
@@ -174,7 +174,7 @@
                Iter2 @\farg{first2}@, Pred @\farg{pred}@);
 
   template<ForwardIterator Iter1, ForwardIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
     Iter1 search(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                  Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
   template<ForwardIterator Iter1, ForwardIterator Iter2,
@@ -183,7 +183,7 @@
                  Iter2 @\farg{first2}@, Iter2 @\farg{last2}@,
                  Pred @\farg{pred}@);
   template<ForwardIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T>
     Iter search_n(Iter @\farg{first}@, Iter @\farg{last}@, Iter::difference_type @\farg{count}@,
                   const T& @\farg{value}@);
   template<ForwardIterator Iter, class T,
@@ -241,7 +241,7 @@
                       BinaryOp @\farg{binary_op}@);
 
   template<MutableForwardIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T> && CopyAssignable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T> && CopyAssignable<Iter::reference, T>
     void replace(Iter @\farg{first}@, Iter @\farg{last}@,
                  const T& @\farg{old_value}@, const T& @\farg{new_value}@);
   @\textcolor{addclr}{template}@<MutableForwardIterator Iter, Predicate<auto, Iter::reference> Pred, class T>
@@ -249,7 +249,7 @@
     void replace_if(Iter @\farg{first}@, Iter @\farg{last}@,
                     Pred @\farg{pred}@, const T& @\farg{new_value}@);
   template<InputIterator InIter, OutputIterator<auto, InIter::value_type> OutIter, class T>
- requires CopyAssignable<OutIter::reference, T> && EqualityComparable<InIter::reference, T>
+ requires CopyAssignable<OutIter::reference, T> && HasEqualTo<InIter::reference, T>
     OutIter replace_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                          OutIter @\farg{result}@,
                          const T& @\farg{old_value}@, const T& @\farg{new_value}@);
@@ -276,7 +276,7 @@
     void generate_n(Iter @\farg{first}@, Size @\farg{n}@, Generator @\farg{gen}@);
 
   template<ForwardIterator Iter, class T>
- requires MoveAssignable<Iter::reference> && EqualityComparable<Iter::reference, T>
+ requires MoveAssignable<Iter::reference> && HasEqualTo<Iter::reference, T>
     Iter remove(Iter @\farg{first}@, Iter @\farg{last}@,
                 const T& @\farg{value}@);
   template<ForwardIterator Iter, Predicate<auto, Iter::reference> Pred>
@@ -284,7 +284,7 @@
     Iter remove_if(Iter @\farg{first}@, Iter @\farg{last}@,
                    Pred @\farg{pred}@);
   template<InputIterator InIter, OutputIterator<auto, InIter::value_type> OutIter, class T>
- requires EqualityComparable<InIter::reference, T>
+ requires HasEqualTo<InIter::reference, T>
     OutIter remove_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                         OutIter @\farg{result}@, const T& @\farg{value}@);
   template<InputIterator InIter, OutputIterator<auto, InIter::value_type> OutIter,
@@ -311,7 +311,7 @@
     OutIter unique_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                         OutIter @\farg{result}@);
   template<InputIterator InIter, MutableForwardIterator OutIter>
- requires EqualityComparable<OutIter::reference, InIter::value_type> &&
+ requires HasEqualTo<OutIter::reference, InIter::value_type> &&
              CopyAssignable<OutIter::reference, InIter::reference> &&
              !ForwardIterator<InIter>
     OutIter unique_copy(InIter @\farg{first}@, InIter @\farg{last}@,
@@ -417,9 +417,9 @@
     requires CopyAssignable<RAIter::reference, InIter::value_type> &&
              SameType<RAIter::value_type&, RAIter::reference> && Swappable<RAIter::value_type> &&
              MoveConstructible<RAIter::value_type> && MoveAssignable<RAIter::value_type> &&
- LessThanComparable<InIter::value_type, RAIter::value_type> &&
- LessThanComparable<RAIter::value_type, InIter::value_type> &&
- LessThanComparable<RAIter::value_type>
+ HasLess<InIter::value_type, RAIter::value_type> &&
+ HasLess<RAIter::value_type, InIter::value_type> &&
+ HasLess<RAIter::value_type>
     RAIter partial_sort_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                              RAIter @\farg{result_first}@, RAIter @\farg{result_last}@);
   template<InputIterator InIter, MutableRandomAccessIterator RAIter, class Compare>
@@ -461,7 +461,7 @@
 
   @\textcolor{black}{// \ref{alg.binary.search}, binary search:}@
   template<ForwardIterator Iter, class T>
- requires LessThanComparable<Iter::reference, T>
+ requires HasLess<Iter::reference, T>
     Iter lower_bound(Iter @\farg{first}@, Iter @\farg{last}@,
                      const T& @\farg{value}@);
   @\textcolor{addclr}{template}@<ForwardIterator Iter, class T, Predicate<auto, Iter::reference, T> Compare>
@@ -469,7 +469,7 @@
                      const T& @\farg{value}@, Compare @\farg{comp}@);
 
   template<ForwardIterator Iter, class T>
- requires LessThanComparable<T, Iter::reference>
+ requires HasLess<T, Iter::reference>
     Iter upper_bound(Iter @\farg{first}@, Iter @\farg{last}@,
                      const T& @\farg{value}@);
   template<ForwardIterator Iter, class T, Predicate<auto, T, Iter::reference> Compare>
@@ -477,8 +477,8 @@
                      const T& @\farg{value}@, Compare @\farg{comp}@);
 
   template<ForwardIterator Iter, class T>
- requires LessThanComparable<T, Iter::reference> &&
- LessThanComparable<Iter::reference, T>
+ requires HasLess<T, Iter::reference> &&
+ HasLess<Iter::reference, T>
     pair<Iter, Iter>
       equal_range(Iter @\farg{first}@,
                   Iter @\farg{last}@, const T& @\farg{value}@);
@@ -491,8 +491,8 @@
                   Compare @\farg{comp}@);
 
   template<ForwardIterator Iter, class T>
- requires LessThanComparable<T, Iter::reference> &&
- LessThanComparable<Iter::reference, T>
+ requires HasLess<T, Iter::reference> &&
+ HasLess<Iter::reference, T>
     bool binary_search(ForwardIterator @\farg{first}@, ForwardIterator @\farg{last}@,
                        const T& @\farg{value}@);
   template<ForwardIterator Iter, class T, class Compare>
@@ -505,7 +505,7 @@
   template<InputIterator InIter1, InputIterator InIter2,
            OutputIterator<auto, InIter1::value_type> OutIter>
     requires SameType<InIter1::value_type, InIter2::value_type> &&
- LessThanComparable<InIter1::value_type>
+ HasLess<InIter1::value_type>
     OutIter merge(InIter1 @\farg{first1}@, InIter1 @\farg{last1}@,
                   InIter2 @\farg{first2}@, InIter2 @\farg{last2}@,
                   OutIter @\farg{result}@);
@@ -716,8 +716,8 @@
       minmax_element(Iter @\farg{first}@, Iter @\farg{last}@, Compare @\farg{comp}@);
 
   template<InputIterator Iter1, InputIterator Iter2>
- @\textcolor{addclr}{requires}@ LessThanComparable<Iter1::reference, Iter2::reference> &&
- LessThanComparable<Iter2::reference, Iter1::reference>
+ @\textcolor{addclr}{requires}@ HasLess<Iter1::reference, Iter2::reference> &&
+ HasLess<Iter2::reference, Iter1::reference>
     bool lexicographical_compare(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                                  Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
 
@@ -736,7 +736,7 @@
   template<MutableBidirectionalIterator Iter,
            Predicate<auto, Iter::reference, Iter::reference> Compare>
     requires SameType<Iter::value_type&, Iter::reference> && Swappable<Iter::value_type>
- bool next_permutation(Iter @\farg{first}@, Iter @\farg{last}@, Compare @\farg{comp}@);
+ @\textcolor{addclr}{}@bool next_permutation(Iter @\farg{first}@, Iter @\farg{last}@, Compare @\farg{comp}@);
   template<MutableBidirectionalIterator Iter>
     requires SameType<Iter::value_type&, Iter::reference> && Swappable<Iter::value_type> &&
              @\textcolor{addclr}{}@LessThanComparable<Iter::reference>
@@ -976,7 +976,7 @@
 \index{find_if@\tcode{find_if}}%
 \color{addclr}\begin{itemdecl}
 @\textcolor{addclr}{template}@<InputIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T>
   Iter find(Iter @\farg{first}@, Iter @\farg{last}@, const T& @\farg{value}@);
 
 template<InputIterator Iter, Predicate<auto, Iter::reference> Pred>
@@ -1007,7 +1007,7 @@
 \index{find_end@\tcode{find_end}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter1, ForwardIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
   Iter1 find_end(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                  Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
 
@@ -1051,7 +1051,7 @@
 \index{find_first_of@\tcode{find_first_of}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator Iter1, ForwardIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
   Iter1 find_first_of(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                       Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
 
@@ -1093,7 +1093,7 @@
 \index{adjacent_find@\tcode{adjacent_find}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter>
- requires EqualityComparable<Iter::reference>
+ requires HasEqualTo<Iter::reference>
   Iter adjacent_find(Iter @\farg{first}@, Iter @\farg{last}@);
 
 template<ForwardIterator Iter, Predicate<auto, Iter::reference, Iter::reference> Pred>
@@ -1133,7 +1133,7 @@
 \index{count_if@\tcode{count_if}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T>
   @\color{addclr}@Iter::difference_type count(Iter @\farg{first}@, Iter @\farg{last}@, const T& @\farg{value}@);
 
 template<InputIterator Iter, Predicate<auto, Iter::reference> Pred>
@@ -1162,7 +1162,7 @@
 \index{mismatch@\tcode{mismatch}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator Iter1, InputIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
   pair<Iter1, Iter2> mismatch(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                               Iter @\farg{first2}@);
 
@@ -1210,7 +1210,7 @@
 \index{equal@\tcode{equal}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator Iter1, InputIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
   bool equal(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
              Iter2 @\farg{first2}@);
 
@@ -1244,7 +1244,7 @@
 \index{search@\tcode{search}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter1, ForwardIterator Iter2>
- requires EqualityComparable<Iter1::reference, Iter2::reference>
+ requires HasEqualTo<Iter1::reference, Iter2::reference>
   Iter1 search(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
 
@@ -1283,7 +1283,7 @@
 
 \color{addclr}\begin{itemdecl}
 @\textcolor{addclr}{template}@<ForwardIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T>
   Iter search_n(Iter @\farg{first}@, Iter @\farg{last}@, Iter::difference_type @\farg{count}@,
                 const T& @\farg{value}@);
 
@@ -1667,7 +1667,7 @@
 \index{replace_if@\tcode{replace_if}}%
 \color{addclr}\begin{itemdecl}
 template<MutableForwardIterator Iter, class T>
- requires EqualityComparable<Iter::reference, T> && CopyAssignable<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T> && CopyAssignable<Iter::reference, T>
   void replace(Iter @\farg{first}@, Iter @\farg{last}@,
                const T& @\farg{old_value}@, const T& @\farg{new_value}@);
 
@@ -1704,7 +1704,7 @@
 \index{replace_copy_if@\tcode{replace_copy_if}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator InIter, OutputIterator<auto, InIter::value_type> OutIter, class T>
- requires CopyAssignable<OutIter::reference, T> && EqualityComparable<InIter::reference, T>
+ requires CopyAssignable<OutIter::reference, T> && HasEqualTo<InIter::reference, T>
   OutIter replace_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                        OutIter @\farg{result}@,
                        const T& @\farg{old_value}@, const T& @\farg{new_value}@);
@@ -1850,7 +1850,7 @@
 \index{remove_if@\tcode{remove_if}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter, class T>
- requires MoveAssignable<Iter::reference> && EqualityComparable<Iter::reference, T>
+ requires MoveAssignable<Iter::reference> && HasEqualTo<Iter::reference, T>
   Iter remove(Iter @\farg{first}@, Iter @\farg{last}@,
               const T& @\farg{value}@);
 
@@ -1892,7 +1892,7 @@
 \index{remove_copy_if@\tcode{remove_copy_if}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator InIter, OutputIterator<auto, InIter::value_type> OutIter, class T>
- requires EqualityComparable<InIter::reference, T>
+ requires HasEqualTo<InIter::reference, T>
   OutIter remove_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                       OutIter @\farg{result}@, const T& @\farg{value}@);
 
@@ -1995,7 +1995,7 @@
                       OutIter @\farg{result}@);
 
 @\textcolor{addclr}{template}@<InputIterator InIter, MutableForwardIterator OutIter>
- requires EqualityComparable<OutIter::reference, InIter::value_type> &&
+ requires HasEqualTo<OutIter::reference, InIter::value_type> &&
            CopyAssignable<OutIter::reference, InIter::reference> &&
            !ForwardIterator<InIter>
   OutIter unique_copy(InIter @\farg{first}@, InIter @\farg{last}@,
@@ -2540,9 +2540,9 @@
   requires CopyAssignable<RAIter::reference, InIter::value_type> &&
            SameType<RAIter::value_type&, RAIter::reference> && Swappable<RAIter::value_type> &&
            MoveConstructible<RAIter::value_type> && MoveAssignable<RAIter::value_type> &&
- LessThanComparable<InIter::value_type, RAIter::value_type> &&
- LessThanComparable<RAIter::value_type, InIter::value_type> &&
- LessThanComparable<RAIter::value_type>
+ HasLess<InIter::value_type, RAIter::value_type> &&
+ HasLess<RAIter::value_type, InIter::value_type> &&
+ HasLess<RAIter::value_type>
   RAIter partial_sort_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                            RAIter @\farg{result_first}@, RAIter @\farg{result_last}@);
 
@@ -2712,7 +2712,7 @@
 \index{lower_bound@\tcode{lower_bound}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter, class T>
- requires LessThanComparable<Iter::reference, T>
+ requires HasLess<Iter::reference, T>
   Iter lower_bound(Iter @\farg{first}@, Iter @\farg{last}@,
                    const T& @\farg{value}@);
 
@@ -2760,7 +2760,7 @@
 \index{upper_bound@\tcode{upper_bound}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter, class T>
- requires LessThanComparable<T, Iter::reference>
+ requires HasLess<T, Iter::reference>
   Iter upper_bound(Iter @\farg{first}@, Iter @\farg{last}@,
                    const T& @\farg{value}@);
 
@@ -2808,8 +2808,8 @@
 \index{equal_range@\tcode{equal_range}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter, class T>
- requires LessThanComparable<T, Iter::reference> &&
- LessThanComparable<Iter::reference, T>
+ requires HasLess<T, Iter::reference> &&
+ HasLess<Iter::reference, T>
   pair<Iter, Iter>
     equal_range(Iter @\farg{first}@,
                 Iter @\farg{last}@, const T& @\farg{value}@);
@@ -2874,8 +2874,8 @@
 \index{binary_search@\tcode{binary_search}}%
 \color{addclr}\begin{itemdecl}
 template<ForwardIterator Iter, class T>
- requires LessThanComparable<T, Iter::reference> &&
- LessThanComparable<Iter::reference, T>
+ requires HasLess<T, Iter::reference> &&
+ HasLess<Iter::reference, T>
   bool binary_search(ForwardIterator @\farg{first}@, ForwardIterator @\farg{last}@,
                      const T& @\farg{value}@);
 
@@ -3950,8 +3950,8 @@
 \index{lexicographical_compare@\tcode{lexicographical_compare}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator Iter1, InputIterator Iter2>
- requires LessThanComparable<Iter1::reference, Iter2::reference> &&
- LessThanComparable<Iter2::reference, Iter1::reference>
+ requires HasLess<Iter1::reference, Iter2::reference> &&
+ HasLess<Iter2::reference, Iter1::reference>
   bool lexicographical_compare(Iter1 @\farg{first1}@, Iter1 @\farg{last1}@,
                                Iter2 @\farg{first2}@, Iter2 @\farg{last2}@);
 

Modified: sandbox/committee/concepts/stdlib/clib-concepts.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-concepts.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-concepts.tex 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -45,7 +45,7 @@
 \end{center}
 
 \vspace{0.25in}
-\par\noindent Document number: D2572=08-0082\vspace{-6pt}
+\par\noindent Document number: N2572=08-0082\vspace{-6pt}
 \par\noindent Revises document number: N2502=08-0012\vspace{-6pt}
 \par\noindent Date: \today\vspace{-6pt}
 \par\noindent Project: Programming Language \Cpp{}, Library Working Group\vspace{-6pt}
@@ -60,43 +60,20 @@
 those in the Standard Library (such as \tcode{CopyConstructible} and
 \tcode{EqualityComparable}).
 
-This proposal adds new functionality into the Standard Library for
-concepts, and is meant as a companion to the language wording for
-concepts, since some of the language wording depends on this library
-wording. More thorough changes to the Standard Library will follow in
-future revisions of the ``Concepts for the \Cpp0x Standard Library''
-proposals.
-
-The concepts in this proposal replace the requirements tables
-currently in [utility.requirements]. This leaves the Standard Library
-in an interesting (but consistent!) state, where the template
-requirements of the Standard Library are described in terms of actual
-concepts, but the templates themselves are not constrained
-templates. For example, a type \tcode{T} in a Standard Library
-algorithm might be stated to be \tcode{CopyConstructible} in the
-current text: previously, that text referred to a requirements table
-for \tcode{CopyConstructible}, whereas now it refers to the
-\tcode{CopyConstructible} concept itself. When the Standard Library is
-fully evolved to use concepts, this informally-stated requirement that
-\tcode{T} is \tcode{CopyConstructible} will be made formal by a
-\tcode{requires} clause stating \tcode{CopyConstructible<T>}. Thus,
-the approach of this proposal is designed to provide an evolutionary
-step toward complete concepts support in the library, while
-improving the description of the library and support for concepts with
-each step.
-
 Within the proposed wording, text that has been added
 \textcolor{addclr}{will be presented in blue} \addedConcepts{and
 underlined when possible}. Text that has been removed will be
 presented \textcolor{remclr}{in red},\removedConcepts{with
-strike-through when possible}. Non-editorial
-changes from the previous wording are \addedCC{highlighted in green}.
+strike-through when possible}.
 
 \editorial{Purely editorial comments will be written in a separate,
   shaded box.}
 
 \paragraph*{Changes from N2502}
-Applied the proposed resolutions for concept issues 4, 6, 9, 10, 12, 14, and 17.
+\begin{itemize}
+\item Applied the proposed resolutions for concept issues 1, 3, 4, 6,
+ 9, 10, 12, 14, and 17.
+\end{itemize}
 
 \end{titlepage}
 
@@ -183,7 +160,7 @@
   concept TriviallyDestructible<typename T> @\textit{see below}@;
 
   // \ref{concept.construct}, construction:
- auto concept Constructible<typename T, typename... Args> @\textit{see below}@;
+ auto concept HasConstructor<typename T, typename... Args> @\textit{see below}@;
   auto concept DefaultConstructible<typename T> @\textit{see below}@;
   concept TriviallyDefaultConstructible<typename T> @\textit{see below}@;
 
@@ -220,7 +197,7 @@
   auto concept HasUnaryPlus<typename T> @\textit{see below}@;
   auto concept HasNegate<typename T> @\textit{see below}@;
   auto concept HasLess<typename T, typename U = T> @\textit{see below}@;
- auto concept HasEquals<typename T, typename U = T> @\textit{see below}@;
+ auto concept HasEqualTo<typename T, typename U = T> @\textit{see below}@;
   auto concept HasLogicalAnd<typename T, typename U = T> @\textit{see below}@;
   auto concept HasLogicalOr<typename T, typename U = T> @\textit{see below}@;
   auto concept HasLogicalNot<typename T> @\textit{see below}@;
@@ -540,13 +517,6 @@
 \end{itemdescr}
 
 \rSec2[concept.comparison]{Comparisons}
-
-\begin{itemdecl}
-auto concept HasLess<typename T, typename U = T> {
- bool operator<(T const& a, U const& b);
-}
-\end{itemdecl}
-
 \begin{itemdescr}
 \pnum
 \addedConcepts{\mbox{\reallynote} describes types with an operator <.}
@@ -557,43 +527,60 @@
   bool operator>(T const& a, T const& b) { return b < a; }
   bool operator<=(T const& a, T const& b) { return !(b < a); }
   bool operator>=(T const& a, T const& b) { return !(a < b); }
+
+ axiom Consistency(T a, T b) {
+ (a > b) == (b < a);
+ (a <= b) == !(b < a);
+ (a >= b) == !(a < b);
+ }
+
+ axiom Irreflexivity(T a) { (a < a) == false; }
+
+ axiom Antisymmetry(T a, T b) {
+ if (a < b) (b < a) == false;
+ }
+
+ axiom Transitivity(T a, T b, T c) {
+ if (a < b && b < c) (a < c) == true;
+ }
+
+ axiom TransitivityOfEquivalence(T a, T b, T c) {
+ if (!(a < b) && !(b < a) && !(b < c) && !(c < b))
+ (!(a < c) && !(c < a)) == true;
+ }
 }
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \addedConcepts{\mbox{\reallynote} describes types whose values can be
- ordered via an inequality operator.}
-
-\pnum
-\addedConcepts{\mbox{\requires}} \tcode{operator<} is a strict
- weak ordering relation (\ref{alg.sorting}).
+ ordered, where \mbox{\tcode{operator<}}
+ is a strict weak ordering relation (\mbox{\ref{alg.sorting}}).}
 \end{itemdescr}
 
 \begin{itemdecl}
-auto concept EqualityComparable<typename T, typename U = T> {
- bool operator==(T const& a, U const& b);
+auto concept EqualityComparable<typename T> : EqualTo<T> {
   bool operator!=(T const& a, U const& b) { return !(a == b); }
+
+ axiom Consistency(T a, T b) {
+ (a == b) == !(a != b);
+ }
+
+ axiom Reflexivity(T a) { a == a; }
+
+ axiom Symmetry(T a, T b) { if (a == b) b == a; }
+
+ axiom Transitivity(T a, T b, T c) {
+ if (a == b && b == c) a == c;
+ }
 }
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \addedConcepts{\mbox{\reallynote} describes types whose values can be
-compared for equality with \mbox{\tcode{operator==}}.}
-
-\pnum
-\addedConcepts{\mbox{\requires}}
-\changedConcepts{W}{w}hen \tcode{T} and \tcode{U} are identical, \tcode{operator==} is an
-equivalence relation, that is, it has the following properties:
-\begin{itemize}
-\item
-For all \tcode{a}, \tcode{a == a}.
-\item
-If \tcode{a == b}, then \tcode{b == a}.
-\item
-If \tcode{a == b} and \tcode{b == c}, then \tcode{a == c}.
-\end{itemize}
+compared for equality with \mbox{\tcode{operator==}}, which is an
+equivalence relation.}
 \end{itemdescr}
 
 \begin{itemdecl}
@@ -654,7 +641,7 @@
 
 \rSec2[concept.construct]{Construction}
 \begin{itemdecl}
-auto concept Constructible<typename T, typename... Args> : Destructible<T> {
+auto concept HasConstructor<typename T, typename... Args> : Destructible<T> {
   T::T(Args...);
 }
 \end{itemdecl}
@@ -666,17 +653,19 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-auto concept DefaultConstructible<typename T> : Constructible<T> { }
+auto concept DefaultConstructible<typename T> : HasConstructor<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
-\addedConcepts{\mbox{\reallynote} describes types that can be default-constructed.}
+\addedConcepts{\mbox{\reallynote} describes types for which an object
+ can be constructed without initializing the object to any particular
+ value.}
 \end{itemdescr}
 
 \rSec2[concept.copymove]{Copy and move}
 \begin{itemdecl}
-auto concept MoveConstructible<typename T> : Constructible<T, T&&>, Destructible<T> { }
+auto concept MoveConstructible<typename T> : HasConstructor<T, T&&> { }
 \end{itemdecl}
 
 \begin{itemdescr}
@@ -688,7 +677,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-T::T(T&& rv); // note: inherited from Constructible<T, T\&\&>
+T::T(T&& rv); // note: inherited from HasConstructor<T, T\&\&>
 \end{itemdecl}
 
 \begin{itemdescr}
@@ -701,7 +690,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-auto concept CopyConstructible<typename T> : MoveConstructible<T>, Constructible<T, const T&> {
+auto concept CopyConstructible<typename T> : MoveConstructible<T>, HasConstructor<T, const T&> {
   @\addedCC{requires EqualityComparable<T>}@
   axiom CopyPreservation(T x) {
     T(x) == x;
@@ -996,6 +985,30 @@
 \end{itemdescr}
 
 \begin{itemdecl}
+auto concept HasLess<typename T, typename U = T> {
+ bool operator<(T const& a, U const& b);
+}
+\end{itemdecl}
+
+\begin{itemdescr}
+\pnum
+\addedConcepts{\mbox{\reallynote} describes types with an
+ \mbox{\tcode{operator<}}.}
+\end{itemdescr}
+
+\begin{itemdecl}
+auto concept HasEqualTo<typename T, typename U = T> {
+ bool operator==(T const& a, U const& b);
+}
+\end{itemdecl}
+
+\begin{itemdescr}
+\pnum
+\addedConcepts{\mbox{\reallynote} describes types with an
+ \mbox{\tcode{operator==}}.}
+\end{itemdescr}
+
+\begin{itemdecl}
 auto concept HasLogicalAnd<typename T, typename U = T> {
   bool operator&&(T const&, U const&);
 }
@@ -1272,7 +1285,10 @@
 \index{requirements!Allocator@\tcode{Allocator}}%
 \editorial{We have kept most of the text of [allocator.requirements]
   here, although much of it has been moved from tables into numbered
- paragraphs when translating the allocator requirements into concepts.}
+ paragraphs when translating the allocator requirements into
+ concepts. With the introduction of scoped allocations, this text is
+ somewhat out of date, and will be revised significantly for the next
+mailing.}
 
 \pnum
 The library describes a standard set of requirements for \techterm{allocators},
@@ -1307,7 +1323,7 @@
   typename const_reference = typename X::const_reference;
   SignedIntegral difference_type = typename X::difference_type;
   UnsignedIntegral size_type = typename X::size_type;
- template<ObjectType T> class rebind = @\textit{see below}@;
+ @\textcolor{addclr}{}@template<ObjectType T> class rebind = @\textit{see below}@;
 
   requires Convertible<pointer, const_pointer> &&
            Convertible<pointer, value_type*> &&
@@ -1476,7 +1492,7 @@
 \color{addclr}
 \begin{itemdecl}
 template<typename V>
- requires Constructible<value_type, V>
+ requires HasConstructor<value_type, V>
   void X::construct(pointer p, V&&);
 \end{itemdecl}
 \color{black}
@@ -1587,8 +1603,4 @@
 semantics of containers and algorithms when allocator instances compare
 non-equal, are implementation-defined.
 
-\section*{Acknowledgments}
-Thanks to Walter Brown and Daniel Kr\"ugler for providing corrections
-to and noting omissions from this document.
-
 \end{document}

Modified: sandbox/committee/concepts/stdlib/clib-iterators.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-iterators.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-iterators.tex 2008-03-16 17:58:39 EDT (Sun, 16 Mar 2008)
@@ -40,7 +40,7 @@
 \end{center}
 
 \vspace{1in}
-\par\noindent Document number: D2570=08-0080 \vspace{-6pt}
+\par\noindent Document number: N2570=08-0080 \vspace{-6pt}
 \par\noindent Revises document number: N2500=08-0010 \vspace{-6pt}
 \par\noindent Date: \today\vspace{-6pt}
 \par\noindent Project: Programming Language \Cpp{}, Library Working Group\vspace{-6pt}
@@ -53,27 +53,6 @@
 \tcode{iterator_traits} specializations that provide backward
 compatibility for existing iterators and generic algorithms.
 
-This proposal adds new functionality into the Standard Library for
-concepts. More thorough changes to the Standard Library will follow in
-future revisions of the ``Concepts for the \Cpp0x Standard Library''
-proposals.
-
-The concepts in this proposal replace the requirements tables
-currently in [iterator.requirements]. This leaves the Standard Library
-in an interesting (but consistent!) state, where the template
-requirements of the Standard Library are described in terms of actual
-concepts, but the templates themselves are not constrained
-templates. For example, a type \tcode{Iter} in a Standard Library
-algorithm might be stated to be an \tcode{InputIterator} in the
-current text: previously, that text referred (implicitly or otherwise)
-to a requirements table for \tcode{InputIterator}, whereas now it
-refers to the \tcode{InputIterator} concept itself. When the Standard
-Library is fully evolved to use concepts, this informally-stated
-requirement will be made formal by a \tcode{requires} claus. Thus, the
-approach of this proposal is designed to provide an evolutionary step
-toward complete concepts support in the library, while improving the
-description of the library and support for concepts with each step.
-
 Within the proposed wording, text that has been added
 \textcolor{addclr}{will be presented in blue} \addedConcepts{and
 underlined when possible}. Text that has been removed will be
@@ -83,6 +62,12 @@
 
 \editorial{Purely editorial comments will be written in a separate,
   shaded box.}
+
+\paragraph*{Changes from N2500}
+\begin{itemize}
+\item Applied the proposed resolutions for concept issues 19, 22, and 25.
+\end{itemize}
+
 \end{titlepage}
 
 %% --------------------------------------------------
@@ -136,8 +121,6 @@
 \synopsis{Header \tcode{<iterator_concepts>}\ synopsis}
 \begin{codeblock}
 namespace std {
- concept IteratorBase<typename X> @\textit{see below}@;
-
   // \ref{input.iterators}, input iterators:
   concept InputIterator<typename X> @\textit{see below}@;
 
@@ -208,16 +191,6 @@
 \techterm{difference type}\
 of the iterator.
 
-\color{addclr}
-\begin{itemdecl}
-concept IteratorBase<typename X> {
- typename value_type = typename X::value_type;
- MoveConstructible reference = typename X::reference;
- MoveConstructible pointer = typename X::pointer;
-}
-\end{itemdecl}
-\color{black}
-
 \pnum
 Since iterators are an abstraction of pointers, their semantics is
 a generalization of most of the semantics of pointers in \Cpp.
@@ -282,7 +255,7 @@
 
 \pnum
 Just as a regular pointer to an array guarantees that there is a pointer value pointing past the last element
-of the array, so for any iterator type there is an iterator value that points past the last element of a
+of the array, so \textcolor{black}{}for any iterator type there is an iterator value that points past the last element of a
 corresponding container.
 These values are called
 \techterm{past-the-end}\
@@ -412,7 +385,11 @@
 
 \color{addclr}
 \begin{codeblock}
-concept InputIterator<typename X> : IteratorBase<X>, Semiregular<X>, EqualityComparable<X> {
+concept InputIterator<typename X> : Semiregular<X>, EqualityComparable<X> {
+ typename value_type = typename X::value_type;
+ MoveConstructible reference = typename X::reference;
+ MoveConstructible pointer = typename X::pointer;
+
   SignedIntegral@\addedCC{Like}@ difference_type = typename X::difference_type;
 
   requires @\addedCC{IntegerType<difference_type>}@
@@ -421,7 +398,7 @@
 
   MoveConstructible postincrement_result;
   requires Dereferenceable<postincrement_result> &&
- Convertible<Dereferenceable<postincrement_result>::reference, value_type>;
+ @\textcolor{addclr}{}@Convertible<Dereferenceable<postincrement_result>::reference, value_type>;
 
   reference operator*(X @\addedCC{const\&}@);
   pointer operator->(X @\addedCC{const\&}@);
@@ -509,16 +486,15 @@
  a pointer to the value referenced by
   the iterator
 
+\begin{itemdecl}
+@\addedCC{bool operator==(X const\& a, X const\& b); // inherited from EqualityComparable<X>}@
+\end{itemdecl}
+
 \pnum
 If two iterators \tcode{a}\ and \tcode{b}\ of the same type are equal, then either \tcode{a}\ and \tcode{b}\
 are both dereferenceable
 or else neither is dereferenceable.
 
-\pnum
-If two iterators \tcode{a}\ and \tcode{b}\ of the same type are both dereferenceable, then \tcode{a == b}\
-if and only if
-\tcode{*a}\ and \tcode{*b}\ are the same object.
-
 \begin{itemdecl}
 X& operator++(X& r);
 \end{itemdecl}
@@ -529,17 +505,17 @@
 
 \pnum
 \postcondition\
-\tcode{r} is dereferenceable or \tcode{r} is past-the-end. any copies
+\tcode{r} is dereferenceable or \tcode{r} is past-the-end. Any copies
 of the previous value of \tcode{r} are no longer required either to be
 dereferenceable or in the domain of \tcode{==}.
 
 \begin{itemdecl}
-postincrement_result operator++(X&, int);
+postincrement_result operator++(X& r, int);
 \end{itemdecl}
 
 \pnum
 \effects\
-\tcode{++r}
+\addedCC{equivalent to \mbox{\tcode{\{ T tmp = *r; ++r; return tmp; \}}}.}
 
 \end{paras}
 
@@ -627,7 +603,10 @@
 
 \color{addclr}
 \begin{itemdecl}
-concept BasicOutputIterator<typename X> : IteratorBase<X>, CopyConstructible<X> {
+concept BasicOutputIterator<typename X> : CopyConstructible<X> {
+ typename value_type = typename X::value_type;
+ MoveConstructible reference = typename X::reference;
+
   requires CopyAssignable<reference, value_type>;
 
   typename postincrement_result;
@@ -635,7 +614,7 @@
            CopyAssignable<Dereferenceable<postincrement_result&>::reference, value_type>,
            Convertible<postincrement_result, const X&>;
 
- reference operator*(X&);
+ @\textcolor{addclr}{}@reference operator*(X&);
   X& operator++(X&);
   postincrement_result operator++(X&, int);
 }
@@ -701,9 +680,18 @@
 \begin{itemdecl}
 concept ForwardIterator<typename X> : InputIterator<X>, Regular<X> {
   requires Convertible<postincrement_result, const X&>;
+
+ @\addedCC{axiom MultiPass(X a, X b) \{}@
+ @\addedCC{if (a == b) *a == *b;}@
+ @\addedCC{if (a == b) ++a == ++b;}@
+ @\addedCC{\&a == \&++a;}@
+ @\addedCC{\}}@
 }
 
-concept MutableForwardIterator<typename X> : ForwardIterator<X>, BasicOutputIterator<X> { }
+concept MutableForwardIterator<typename X> : ForwardIterator<X>, BasicOutputIterator<X> {
+ requires SameType<ForwardIterator<X>::value_type, BasicOutputIterator<X>::value_type> &&
+ SameType<ForwardIterator<X>::reference, BasicOutputIterator<X>::reference>;
+}
 \end{itemdecl}
 \color{black}
 
@@ -720,9 +708,32 @@
   we permit proxy iterators to model the forward, bidirectional, and
   random access iterator concepts.}
 
+\begin{itemdecl}
+@\addedCC{X::X(); // inherited from Regular<X>}@
+\end{itemdecl}
+
+\begin{itemdescr}
+ \pnum \addedCC{\mbox{\reallynote} the constructed object might have
+ a singular value.}
+\end{itemdescr}
+
+\begin{itemdecl}
+@\addedCC{reference operator*(X\&);}@
+@\addedCC{reference operator*(X const\&);}@
+\end{itemdecl}
+
+\begin{itemdescr}
+\pnum
+\addedCC{\mbox{\requires} If two iterators \mbox{\tcode{a}} and
+ \mbox{\tcode{b}} of the same type are both dereferenceable, then
+ \mbox{\tcode{a == b}} if and only if \mbox{\tcode{*a}} and
+ \mbox{\tcode{*b}} are the same object.}
+
+\end{itemdescr}
+
 \textcolor{black}{}\pnum
 \enternote\
-The condition that
+The \changedConcepts{condition}{axiom} that
 \tcode{a == b}\
 implies
 \tcode{++a == ++b}\
@@ -757,6 +768,12 @@
 
   X& operator--(X&);
   postdecrement_result operator--(X&, int);
+
+ @\addedCC{axiom BackwardTraversal(X a, X b) \{}@
+ --(++a) == a;
+ if (--a == --b) a == b;
+ &a == &--a;
+ @\addedCC{\}}@
 }
 
 concept MutableBidirectionalIterator<typename X>
@@ -782,12 +799,6 @@
 \postcondition\
 \tcode{r}\ is dereferenceable.
 
-\pnum
-\effects\
-\tcode{\dcr(++r) == r}. \\
- \tcode{\dcr r == \dcr s}\ implies \tcode{r == s}. \\
- \tcode{\&r == \&\dcr r}.
-
 \begin{itemdecl}
 postdecrement_result operator--(X& r, int);
 \end{itemdecl}


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