Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48733 - sandbox/committee/concepts/stdlib
From: dgregor_at_[hidden]
Date: 2008-09-11 09:35:34


Author: dgregor
Date: 2008-09-11 09:35:34 EDT (Thu, 11 Sep 2008)
New Revision: 48733
URL: http://svn.boost.org/trac/boost/changeset/48733

Log:
Various concepts fixes
Text files modified:
   sandbox/committee/concepts/stdlib/clib-concepts.tex | 9 +++++----
   sandbox/committee/concepts/stdlib/clib-containers.tex | 17 ++++++++++++-----
   2 files changed, 17 insertions(+), 9 deletions(-)

Modified: sandbox/committee/concepts/stdlib/clib-concepts.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-concepts.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-concepts.tex 2008-09-11 09:35:34 EDT (Thu, 11 Sep 2008)
@@ -149,6 +149,7 @@
     concepts \tcode{Union}, \tcode{TrivialType},
     \tcode{StandardLayoutType}, \tcode{LiteralType}, and
     \tcode{NonTypeTemplateParameterType} all refine this new concept.
+ \item \tcode{VariableType} refines \tcode{ReferentType}.
   \end{itemize}
 
 \end{titlepage}
@@ -450,7 +451,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept VariableType<typename T> { }
+concept VariableType<typename T> : ReferentType<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
@@ -555,7 +556,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept TrivialType<typename T> : ObjectType<T>, ValueType<T> { }
+concept TrivialType<typename T> : ValueType<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
@@ -569,7 +570,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept StandardLayoutType<typename T> : ObjectType<T>, ValueType<T> { }
+concept StandardLayoutType<typename T> : ValueType<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}
@@ -584,7 +585,7 @@
 \end{itemdescr}
 
 \begin{itemdecl}
-concept LiteralType<typename T> : ObjectType<T>, ValueType<T> { }
+concept LiteralType<typename T> : ValueType<T> { }
 \end{itemdecl}
 
 \begin{itemdescr}

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-11 09:35:34 EDT (Thu, 11 Sep 2008)
@@ -96,7 +96,8 @@
   issue \#48. Also, added same-type requirements tying the
   \tcode{reference} types of a container's iterators to the
   \tcode{reference} and \tcode{const_reference} types of the
- container.
+ container, and convertibility from the \tcode{difference_type} of a
+ container's iterators to its \tcode{size_type}.
 \item Use the new \tcode{ValueType} concept, rather than
   \tcode{ObjectType}, to constrain the container's element types, to
   properly exclude abstract classes.
@@ -950,7 +951,7 @@
 
 \begin{itemdecl}
 concept Container<typename C> {
- ValueType value_type = typename C::value_type;
+ ValueType value_type = typename C::value_type;
   typename reference = typename C::reference;
   typename const_reference = typename C::const_reference;
   UnsignedIntegralLike size_type = typename C::size_type;
@@ -962,7 +963,10 @@
         && SameType<ForwardIterator<iterator>::value_type, value_type>
         && SameType<ForwardIterator<const_iterator>::value_type, value_type>
         && SameType<ForwardIterator<iterator>::reference, reference>
- && SameType<ForwardIterator<const_iterator>::reference, const_reference>;
+ && SameType<ForwardIterator<const_iterator>::reference, const_reference>
+ && SameType<ForwardIterator<iterator>::difference_type,
+ ForwardIterator<const_iterator>::difference_type>
+ && Convertible<ForwardIterator<iterator>::difference_type, size_type>;
 
   bool empty(const C& c) { return begin(c) == end(c); }
   size_type size(const C& c) { return std::distance(begin(c), end(c)); }
@@ -1130,7 +1134,7 @@
 \color{addclr}
 \begin{itemdecl}
 auto concept MemberContainer<typename C> {
- ValueType value_type = typename C::value_type;
+ ValueType value_type = typename C::value_type;
   typename reference = typename C::reference;
   typename const_reference = typename C::const_reference;
   UnsignedIntegralLike size_type = typename C::size_type;
@@ -1141,7 +1145,10 @@
         && SameType<ForwardIterator<iterator>::value_type, value_type>
         && SameType<ForwardIterator<const_iterator>::value_type, value_type>
         && SameType<ForwardIterator<iterator>::reference, reference>
- && SameType<ForwardIterator<const_iterator>::reference, const_reference>;
+ && SameType<ForwardIterator<const_iterator>::reference, const_reference>
+ && SameType<ForwardIterator<iterator>::difference_type,
+ ForwardIterator<const_iterator>::difference_type>
+ && Convertible<ForwardIterator<iterator>::difference_type, size_type>;
 
   bool C::empty() const { return this->begin() == this->end(); }
   size_type C::size() const { return std::distance(this->begin(), this->end()); }


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