Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48708 - in sandbox/committee/concepts: issues/issues stdlib wording
From: dgregor_at_[hidden]
Date: 2008-09-10 17:36:03


Author: dgregor
Date: 2008-09-10 17:36:03 EDT (Wed, 10 Sep 2008)
New Revision: 48708
URL: http://svn.boost.org/trac/boost/changeset/48708

Log:
Add iterator convertability requirement to Container concepts
Text files modified:
   sandbox/committee/concepts/issues/issues/issue48.xml | 2 +-
   sandbox/committee/concepts/stdlib/clib-containers.tex | 11 +++++++----
   sandbox/committee/concepts/wording/wording.tex | 2 +-
   3 files changed, 9 insertions(+), 6 deletions(-)

Modified: sandbox/committee/concepts/issues/issues/issue48.xml
==============================================================================
--- sandbox/committee/concepts/issues/issues/issue48.xml (original)
+++ sandbox/committee/concepts/issues/issues/issue48.xml 2008-09-10 17:36:03 EDT (Wed, 10 Sep 2008)
@@ -3,7 +3,7 @@
   <!ENTITY nbsp "&#160;">
 ] >
 
-<issue num="48" status="New">
+<issue num="48" status="WP">
   <title>Missing <code>iterator</code> to <code>const_iterator</code> conversion</title>
 <section><sref ref="[container.concepts]"/></section>
 <submitter>LWG</submitter>

Modified: sandbox/committee/concepts/stdlib/clib-containers.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-containers.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-containers.tex 2008-09-10 17:36:03 EDT (Wed, 10 Sep 2008)
@@ -91,6 +91,7 @@
   value inserted is the value now stored at the place of
   insertion. Also, added *\tcode{Insertion} axioms to the emplace
   concepts (all thanks to Alisdair Meredith).
+\item Convertibility requirement from \tcode{iterator} to \tcode{const_iterator} in the container concepts. Resolves concepts issue \#48.
 \end{itemize}
 
 \end{titlepage}
@@ -949,8 +950,9 @@
   ForwardIterator iterator;
   ForwardIterator const_iterator;
 
- requires SameType<ForwardIterator<iterator>::value_type, value_type>
- && SameType<ForwardIterator<const_iterator>::value_type, value_type>;
+ requires Convertible<iterator, const_iterator>
+ && SameType<ForwardIterator<iterator>::value_type, value_type>
+ && SameType<ForwardIterator<const_iterator>::value_type, value_type>;
 
   bool empty(const C& c) { return begin(c) == end(c); }
   size_type size(const C& c) { return std::distance(begin(c), end(c)); }
@@ -1125,8 +1127,9 @@
 
   ForwardIterator iterator;
   ForwardIterator const_iterator;
- requires SameType<ForwardIterator<iterator>::value_type, value_type>
- && SameType<ForwardIterator<const_iterator>::value_type, value_type>;
+ requires Convertible<iterator, const_iterator>
+ && SameType<ForwardIterator<iterator>::value_type, value_type>
+ && SameType<ForwardIterator<const_iterator>::value_type, value_type>;
 
   bool C::empty() const { return this->begin() == this->end(); }
   size_type C::size() const { return std::distance(this->begin(), this->end()); }

Modified: sandbox/committee/concepts/wording/wording.tex
==============================================================================
--- sandbox/committee/concepts/wording/wording.tex (original)
+++ sandbox/committee/concepts/wording/wording.tex 2008-09-10 17:36:03 EDT (Wed, 10 Sep 2008)
@@ -524,7 +524,7 @@
 \pnum
 \index{name!qualified}%
 \index{qualification!explicit}%
-The name of a class\addedConcepts{, concept map (but not concept),} or
+The name of a class\addedConcepts{, concept map (but not a concept),} or
 namespace member
 or enumerator can be referred to after the
 \tcode{::}\


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