Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48887 - sandbox/committee/concepts/stdlib
From: dgregor_at_[hidden]
Date: 2008-09-19 05:58:24


Author: dgregor
Date: 2008-09-19 05:58:24 EDT (Fri, 19 Sep 2008)
New Revision: 48887
URL: http://svn.boost.org/trac/boost/changeset/48887

Log:
Fix iterators with move-only types
Text files modified:
   sandbox/committee/concepts/stdlib/clib-iterators.tex | 37 ++++++++++++++++++++++---------------
   1 files changed, 22 insertions(+), 15 deletions(-)

Modified: sandbox/committee/concepts/stdlib/clib-iterators.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-iterators.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-iterators.tex 2008-09-19 05:58:24 EDT (Fri, 19 Sep 2008)
@@ -76,6 +76,7 @@
   iterator adaptors' \tcode{operator-} operations, use the
   \tcode{base()} function rather than \tcode{current} to retrieve the
   underlying iterator.
+\item Fixed support for move-only types in \tcode{back_insert_iterator}, \tcode{front_insert_iterator}, and \tcode{insert_iterator}.
 \end{itemize}
 \end{titlepage}
 
@@ -1047,8 +1048,9 @@
     @\addedConcepts{typedef void pointer;}@
 
     explicit back_insert_iterator(Cont@\removedConcepts{ainer}@& x);
- back_insert_iterator<Cont@\removedConcepts{ainer}@>&
- operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
+ @\addedConcepts{requires CopyConstructible<Cont::value_type>}@
+ back_insert_iterator<Cont@\removedConcepts{ainer}@>&
+ operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
     back_insert_iterator<Cont@\removedConcepts{ainer}@>&
       operator=(@\removedConcepts{typename }@Cont@\removedConcepts{ainer}@::value_type&& value);
 
@@ -1086,14 +1088,15 @@
 
 \index{operator=@\tcode{operator=}!\tcode{back_insert_iterator}}%
 \begin{itemdecl}
-back_insert_iterator<Cont@\removedConcepts{ainer}@>&
- operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
+@\addedConcepts{requires CopyConstructible<Cont::value_type>}@
+ back_insert_iterator<Cont@\removedConcepts{ainer}@>&
+ operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \effects\
-\tcode{\removedConcepts{container->}push_back(\addedConcepts{*container, }value);}\
+\tcode{\removedConcepts{container->}push_back(\addedConcepts{*container, Cont::value_type(}value\addedConcepts{)});}\
 
 \pnum
 \returns\
@@ -1187,8 +1190,9 @@
     @\addedConcepts{typedef void pointer;}@
 
     explicit front_insert_iterator(Cont@\removedConcepts{ainer}@& x);
- front_insert_iterator<Cont@\removedConcepts{ainer}@>&
- operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
+ @\addedConcepts{requires CopyConstructible<Cont::value_type>}@
+ front_insert_iterator<Cont@\removedConcepts{ainer}@>&
+ operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
     front_insert_iterator<Cont@\removedConcepts{ainer}@>&
       operator=(@\removedConcepts{typename}@ Cont@\removedConcepts{ainer}@::value_type&& value);
 
@@ -1226,14 +1230,15 @@
 
 \index{operator=@\tcode{operator=}!\tcode{front_insert_iterator}}%
 \begin{itemdecl}
-front_insert_iterator<Cont@\removedConcepts{ainer}@>&
- operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
+@\addedConcepts{requires CopyConstructible<Cont::value_type>}@
+ front_insert_iterator<Cont@\removedConcepts{ainer}@>&
+ operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \effects\
-\tcode{\removedConcepts{container->}push_front(\addedConcepts{*container, }value);}\
+\tcode{\removedConcepts{container->}push_front(\addedConcepts{*container, Cont::value_type(}value\addedConcepts{)});}\
 
 \pnum
 \returns\
@@ -1328,8 +1333,9 @@
     @\addedConcepts{typedef void pointer;}@
 
     insert_iterator(Cont@\removedConcepts{ainer}@& x, @\removedConcepts{typename }@Cont@\removedConcepts{ainer}@::iterator i);
- insert_iterator<Cont@\removedConcepts{ainer}@>&
- operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
+ @\addedConcepts{requires CopyConstructible<Cont::value_type>}@
+ insert_iterator<Cont@\removedConcepts{ainer}@>&
+ operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
     insert_iterator<Cont@\removedConcepts{ainer}@>&
       operator=(@\removedConcepts{typename }@Cont@\removedConcepts{ainer}@::value_type&& value);
 
@@ -1369,15 +1375,16 @@
 
 \index{operator=@\tcode{operator=}!\tcode{insert_iterator}}%
 \begin{itemdecl}
-insert_iterator<Cont@\removedConcepts{ainer}@>&
- operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
+@\addedConcepts{requires CopyConstructible<Cont::value_type>}@
+ insert_iterator<Cont@\removedConcepts{ainer}@>&
+ operator=(@\changedConcepts{typename}{const}@ Cont@\removedConcepts{ainer}@::@\changedConcepts{const_reference}{value_type\&}@ value);
 \end{itemdecl}
 
 \begin{itemdescr}
 \pnum
 \effects\
 \begin{codeblock}
-iter = @\removedConcepts{container->}@insert(@\addedConcepts{*container, }@iter, value);
+iter = @\removedConcepts{container->}@insert(@\addedConcepts{*container, }@iter, @\addedConcepts{Cont::value_type(}@value@\addedConcepts{)}@);
 ++iter;
 \end{codeblock}
 


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