Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48688 - sandbox/committee/concepts/stdlib
From: dgregor_at_[hidden]
Date: 2008-09-09 13:29:06


Author: dgregor
Date: 2008-09-09 13:29:05 EDT (Tue, 09 Sep 2008)
New Revision: 48688
URL: http://svn.boost.org/trac/boost/changeset/48688

Log:
Address some comments from Daniel Kruegler
Text files modified:
   sandbox/committee/concepts/stdlib/clib-iterconcepts.tex | 54 ++++++++++++++++++++++++++++-----------
   1 files changed, 38 insertions(+), 16 deletions(-)

Modified: sandbox/committee/concepts/stdlib/clib-iterconcepts.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-iterconcepts.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-iterconcepts.tex 2008-09-09 13:29:05 EDT (Tue, 09 Sep 2008)
@@ -50,7 +50,7 @@
 \begin{center}
 \huge
 Iterator Concepts for the C++0x Standard Library\\
-(Revision 4)
+(Revision 5)
 \vspace{0.5in}
 
 \normalsize
@@ -59,8 +59,8 @@
 \end{center}
 
 \vspace{1in}
-\par\noindent Document number: N2739=08-0249 \vspace{-6pt}
-\par\noindent Revises document number: N2695=08-0205 \vspace{-6pt}
+\par\noindent Document number: DRAFT \vspace{-6pt}
+\par\noindent Revises document number: N2739=08-0249 \vspace{-6pt}
 \par\noindent Date: \today\vspace{-6pt}
 \par\noindent Project: Programming Language \Cpp{}, Library Working Group\vspace{-6pt}
 \par\noindent Reply-to: Douglas Gregor $<$\href{mailto:dgregor_at_[hidden]}{dgregor_at_[hidden]}$>$\vspace{-6pt}
@@ -252,6 +252,19 @@
 refactoring came from implementation experience: the \tcode{operator*}
 ambiguity, for example, was initially detected by ConceptGCC.
 
+\paragraph*{Changes from N2739}
+\begin{itemize}
+\item Moved the dereferenceability requirement on \tcode{operator*}
+ from the \tcode{InputIterator} concept to the \tcode{Iterator}
+ concept, since it applies to all iterators.
+\item Translated the \tcode{BackwardTraversal} axiom of the
+ \tcode{BidirectionalIterator} concept back into normative text,
+ since we can't easily express the preconditions of the operations
+ used.
+\item Fixed the associated function default implementations in
+ \tcode{RandomAccessIterator}.
+\end{itemize}
+
 \paragraph*{Changes from N2695}
 \begin{itemize}
 \item Replaced the \tcode{HasStdMove} concept (and its uses) with
@@ -641,9 +654,20 @@
   non-const copy of the iterator to dereference. We have verified this
   change with ConceptGCC and found no ill effects.}
 
+\color{addclr}
+\begin{itemdecl}
+reference operator*(X&& @\farg{a}@);
+\end{itemdecl}
+
+\pnum
+\addedConcepts{\mbox{\requires}
+\mbox{\tcode{\farg{a}}}
+is dereferenceable.}
+
 \begin{itemdecl}
 postincrement_result operator++(X& r, int);
 \end{itemdecl}
+\color{black}
 
 \pnum
 \effects\
@@ -738,11 +762,6 @@
 \end{itemdecl}
 
 \pnum
-\addedConcepts{\mbox{\requires}
-\mbox{\tcode{\farg{a}}}
-is dereferenceable.}
-
-\pnum
 \addedConcepts{\mbox{\returns}
 the value referenced by the iterator}
 
@@ -950,11 +969,6 @@
 
   X& operator--(X&);
   postdecrement_result operator--(X&, int);
-
- axiom BackwardTraversal(X a, X b) {
- --(++a) == a;
- if (--a == --b) a == b;
- }
 }
 \end{itemdecl}
 \color{black}
@@ -974,6 +988,12 @@
 there exists \mbox{\tcode{s}} such that \mbox{\tcode{r == ++s}}.}
 
 \pnum
+\addedConcepts{\mbox{\requires}
+\mbox{\tcode{-{}-(++r) == r}} and,
+given lvalues \mbox{\tcode{a}} and \mbox{\tcode{b}} of type \mbox{\tcode{X}},
+\mbox{\tcode{-{}-a == -{}-b}} implies \mbox{\tcode{a == b}}}
+
+\pnum
 \addedConcepts{\mbox{\postcondition}
 \mbox{\tcode{r}} is dereferenceable.}
 \addedConcepts{\mbox{\tcode{\&r == \&{-}{-}r}}.}
@@ -1011,10 +1031,10 @@
   requires Convertible<subscript_reference, const value_type&>;
 
   X& operator+=(X&, difference_type);
- X operator+ (const X& x, difference_type n) { X tmp(x); x += n; return x; }
- X operator+ (difference_type n, const X& x) { X tmp(x); x += n; return x; }
+ X operator+ (const X& x, difference_type n) { X tmp(x); tmp += n; return tmp; }
+ X operator+ (difference_type n, const X& x) { X tmp(x); tmp += n; return tmp; }
   X& operator-=(X&, difference_type);
- X operator- (const X& x, difference_type n) { X tmp(x); x -= n; return x; }
+ X operator- (const X& x, difference_type n) { X tmp(x); tmp -= n; return tmp; }
 
   difference_type operator-(const X&, const X&);
   subscript_reference operator[](const X& x, difference_type n);
@@ -1250,6 +1270,8 @@
 
 may be defined as \tcode{void}.
 
+\editorial{Paragraphs 2--5 of this section are unchanged.}
+
 \setcounter{Paras}{5}
 \pnum
 \addedConcepts{For each iterator category, a partial specializations of the


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