Boost logo

Boost-Commit :

From: mmarcus_at_[hidden]
Date: 2008-06-26 18:45:06


Author: mmarcus
Date: 2008-06-26 18:45:05 EDT (Thu, 26 Jun 2008)
New Revision: 46752
URL: http://svn.boost.org/trac/boost/changeset/46752

Log:
First pass fix of most HasCopyAssign/HasMoveAssign to HasAssign. A
couple of other smaller fixes. Algorithms switched over, some work
remains in iter and util.

Text files modified:
   sandbox/committee/concepts/stdlib/clib-algorithms.tex | 51 +++++++++++++++++++++------------------
   sandbox/committee/concepts/stdlib/lib-issues.txt | 17 ++++++++----
   2 files changed, 39 insertions(+), 29 deletions(-)

Modified: sandbox/committee/concepts/stdlib/clib-algorithms.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-algorithms.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-algorithms.tex 2008-06-26 18:45:05 EDT (Thu, 26 Jun 2008)
@@ -275,37 +275,39 @@
                       BinaryOp @\farg{binary_op}@);
 
   template<MutableForwardIterator Iter, class T>
- requires HasEqualTo<Iter::reference, T> && HasCopyAssign<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T> &&
+ Has@\removedCCC{Copy}@Assign<Iter::reference, @\changedCCC{T}{const T\&}@>
     void replace(Iter @\farg{first}@, Iter @\farg{last}@,
                  const T& @\farg{old_value}@, const T&
                  @\farg{new_value}@);
 % revisit (mmarcus): still a mutable iterator?
   @\textcolor{addclr}{template}@<MutableForwardIterator Iter, Predicate<auto, Iter::@\changedCCC{reference}{value_type}@> Pred, class T>
- requires HasCopyAssign<Iter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<Iter::reference, @\changedCCC{T}{const T\&}@>
     void replace_if(Iter @\farg{first}@, Iter @\farg{last}@,
                     Pred @\farg{pred}@, const T& @\farg{new_value}@);
   template<InputIterator InIter,
            OutputIterator<auto, InIter::@\changedCCC{value_type}{reference}@> OutIter, class T>
- requires HasCopyAssign<OutIter::reference, T> && HasEqualTo<InIter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<Iter::reference, @\changedCCC{T}{const 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}@);
   template<InputIterator InIter, OutputIterator<auto, InIter::@\changedCCC{value_type}{reference}@> OutIter,
            Predicate<auto, InIter::@\changedCCC{reference}{value_type}@> Pred, class T>
- requires HasCopyAssign<OutIter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<OutIter::reference, @\changedCCC{T}{const T\&}@>
     OutIter replace_copy_if(InIter @\farg{first}@, InIter @\farg{last}@,
                             OutIter @\farg{result}@,
                             Pred @\farg{pred}@, const T& @\farg{new_value}@);
 
   template<MutableForwardIterator Iter, class T>
- requires HasCopyAssign<Iter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<Iter::reference, @\changedCCC{T}{const T\&}@>
     void fill(Iter @\farg{first}@, Iter @\farg{last}@, const T& @\farg{value}@);
   template<class Iter, IntegralLike Size, class T>
     requires OutputIterator<Iter, T>
     void fill_n(Iter @\farg{first}@, Size @\farg{n}@, const T& @\farg{value}@);
 
   template<MutableForwardIterator Iter, Callable Generator>
- requires HasCopyAssign<Iter::reference, Generator::result_type>
+ requires Has@\removedCCC{Copy}@Assign<Iter::reference, Generator::result_type>
     void generate(Iter @\farg{first}@, Iter @\farg{last}@,
                   Generator @\farg{gen}@);
   template<class Iter, IntegralLike Size, Callable Generator>
@@ -350,7 +352,7 @@
                         OutIter @\farg{result}@);
   template<InputIterator InIter, MutableForwardIterator OutIter>
     requires HasEqualTo<OutIter::reference, InIter::@\changedCCC{value_type}{reference}@> &&
- HasCopyAssign<OutIter::reference, InIter::reference> &&
+ Has@\removedCCC{Copy}@Assign<OutIter::reference, InIter::reference> &&
              !ForwardIterator<InIter>
     OutIter unique_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                         OutIter @\farg{result}@);
@@ -366,7 +368,7 @@
                         OutIter @\farg{result}@);
   template<InputIterator InIter, MutableForwardIterator OutIter,
            Predicate<auto, OutIter::@\changedCCC{reference}{value_type}@, InIter::@\changedCCC{reference}{value_type}@> Pred>
- requires HasCopyAssign<OutIter::reference, InIter::reference> &&
+ requires Has@\removedCCC{Copy}@Assign<OutIter::reference, InIter::reference> &&
              !ForwardIterator<InIter>
     OutIter unique_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                         OutIter @\farg{result}@, Pred @\farg{pred}@);
@@ -382,7 +384,7 @@
     requires @\changedCCC{SwappableIterator<Iter>}{Swappable<Iter::reference>}@
     void rotate(Iter @\farg{first}@, Iter @\farg{middle}@,
                 Iter @\farg{last}@);
- template<ForwardIterator InIter, OutputIterator<auto, InIter::value_type> OutIter>
+ template<ForwardIterator InIter, OutputIterator<auto, InIter::@\changedCCC{value_type}{reference}@> OutIter>
     OutIter rotate_copy(InIter @\farg{first}@, InIter @\farg{middle}@,
                         InIter @\farg{last}@, OutIter @\farg{result}@);
 
@@ -445,7 +447,7 @@
                       Iter @\farg{last}@,
                       Compare @\farg{comp}@);
   template<InputIterator InIter, RandomAccessIterator RAIter>
- requires HasCopyAssign<RAIter::reference, InIter::value_type> &&
+ requires Has@\removedCCC{Copy}@Assign<RAIter::reference, InIter::@\changedCCC{value_type}{reference}@> &&
              @\changedCCC{SwappableIterator<RAIter>}{Swappable<RAIter::reference>}@ &&
              HasLess<InIter::value_type, RAIter::value_type> &&
              HasLess<RAIter::value_type, InIter::value_type> &&
@@ -453,7 +455,7 @@
     RAIter partial_sort_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                              RAIter @\farg{result_first}@, RAIter @\farg{result_last}@);
   template<InputIterator InIter, RandomAccessIterator RAIter, class Compare>
- requires HasCopyAssign<RAIter::reference, InIter::value_type> &&
+ requires Has@\removedCCC{Copy}@Assign<RAIter::reference, InIter::@\changedCCC{value_type}{reference}@> &&
              @\changedCCC{SwappableIterator<RAIter>}{Swappable<RAIter::reference>}@ &&
              Predicate<Compare, InIter::value_type, RAIter::value_type> &&
              Predicate<Compare, RAIter::value_type, InIter::value_type> &&
@@ -1421,6 +1423,7 @@
 
 \index{copy_backward@\tcode{copy_backward}}%
 \color{addclr}\begin{itemdecl}
+
 template<BidirectionalIterator InIter, @\removedCCC{Mutable}@BidirectionalIterator OutIter>
   requires Has@\removedCCC{Copy}@Assign<OutIter::reference, InIter::reference>
   OutIter copy_backward(InIter @\farg{first}@, InIter @\farg{last}@,
@@ -1510,6 +1513,7 @@
 \color{addclr}
 \begin{itemdecl}
 template<BidirectionalIterator InIter, BidirectionalIterator OutIter>
+
   requires Has@\removedCCC{Move}@Assign<OutIter::reference, InIter::value_type@\addedCC{\&\&}@>
   OutIter move_backward(InIter first, InIter last,
                         OutIter result);
@@ -1715,13 +1719,14 @@
 \index{replace_if@\tcode{replace_if}}%
 \color{addclr}\begin{itemdecl}
 template<MutableForwardIterator Iter, class T>
- requires HasEqualTo<Iter::reference, T> && HasCopyAssign<Iter::reference, T>
+ requires HasEqualTo<Iter::reference, T> &&
+ Has@\removedCCC{Copy}@Assign<Iter::reference, @\changedCCC{T}{const T\&}@>
   void replace(Iter @\farg{first}@, Iter @\farg{last}@,
                const T& @\farg{old_value}@, const T& @\farg{new_value}@);
 
 % revisit (mmarcus): Still want Mutable iterators?
 @\textcolor{addclr}{template}@<MutableForwardIterator Iter, Predicate<auto, Iter::@\changedCCC{reference}{value_type}@> Pred, class T>
- requires HasCopyAssign<Iter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<Iter::reference, @\changedCCC{T}{const T\&}@>
   void replace_if(Iter @\farg{first}@, Iter @\farg{last}@,
                   Pred @\farg{pred}@, const T& @\farg{new_value}@);
 \end{itemdecl}\color{black}
@@ -1753,14 +1758,14 @@
 \index{replace_copy_if@\tcode{replace_copy_if}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator InIter, OutputIterator<auto, InIter::@\changedCCC{value_type}{reference}@> OutIter, class T>
- requires HasCopyAssign<OutIter::reference, T> && HasEqualTo<InIter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<OutIter::reference, @\changedCCC{T}{const 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}@);
 
 template<InputIterator InIter, OutputIterator<auto, InIter::@\changedCCC{value_type}{reference}@> OutIter,
          Predicate<auto, InIter::@\changedCCC{reference}{value_type}@> Pred, class T>
- requires HasCopyAssign<OutIter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<OutIter::reference, @\changedCCC{T}{const T\&}@>
   OutIter replace_copy_if(InIter @\farg{first}@, InIter @\farg{last}@,
                           OutIter @\farg{result}@,
                           Pred @\farg{pred}@, const T& @\farg{new_value}@);
@@ -1817,7 +1822,7 @@
 \index{fill_n@\tcode{fill_n}}%
 \color{addclr}\begin{itemdecl}
 template<MutableForwardIterator Iter, class T>
- requires HasCopyAssign<Iter::reference, T>
+ requires Has@\removedCCC{Copy}@Assign<Iter::reference, @\changedCCC{T}{const T\&}@>
   void fill(Iter @\farg{first}@, Iter @\farg{last}@, const T& @\farg{value}@);
 
 template<class Iter, IntegralLike Size, class T>
@@ -1856,7 +1861,7 @@
 \index{generate_n@\tcode{generate_n}}%
 \color{addclr}\begin{itemdecl}
 template<MutableForwardIterator Iter, Callable Generator>
- requires HasCopyAssign<Iter::reference, Generator::result_type>
+ requires Has@\removedCCC{Copy}@Assign<Iter::reference, Generator::result_type>
   void generate(Iter @\farg{first}@, Iter @\farg{last}@,
                 Generator @\farg{gen}@);
 
@@ -2045,7 +2050,7 @@
 
 @\textcolor{addclr}{template}@<InputIterator InIter, MutableForwardIterator OutIter>
   requires HasEqualTo<OutIter::reference, InIter::@\changedCCC{value_type}{reference}@> &&
- HasCopyAssign<OutIter::reference, InIter::reference> &&
+ Has@\removedCCC{Copy}@Assign<OutIter::reference, InIter::reference> &&
            !ForwardIterator<InIter>
   OutIter unique_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                       OutIter @\farg{result}@);
@@ -2064,7 +2069,7 @@
 
 template<InputIterator InIter, MutableForwardIterator OutIter,
          Predicate<auto, OutIter::@\changedCCC{reference}{value_type}@, InIter::@\changedCCC{reference}{value_type}@> Pred>
- requires HasCopyAssign<OutIter::reference, InIter::reference> &&
+ requires Has@\removedCCC{Copy}@Assign<OutIter::reference, InIter::reference> &&
            !ForwardIterator<InIter>
   OutIter unique_copy(InIter @\farg{first}@, InIter @\farg{last}@,
                       OutIter @\farg{result}@, Pred @\farg{pred}@);
@@ -2072,7 +2077,7 @@
 \color{black}
 
 \editorial{We assume (and require!) the proposed resolution to DR 538,
- which adds the \tcode{HasCopyAssign} requirement.}
+ which adds the \tcode{Has\removedCCC{Copy}Assign} requirement.}
 
 \editorial{Note that we have split the two signatures of
   \tcode{unique_copy} into six signatures, to cover the actual
@@ -2231,7 +2236,7 @@
 
 \index{rotate_copy@\tcode{rotate_copy}}%
 \color{addclr}\begin{itemdecl}
-template<ForwardIterator InIter, OutputIterator<auto, InIter::value_type> OutIter>
+template<ForwardIterator InIter, OutputIterator<auto, InIter::@\changedCCC{value_type}{reference}@> OutIter>
   OutIter rotate_copy(InIter @\farg{first}@, InIter @\farg{middle}@,
                       InIter @\farg{last}@, OutIter @\farg{result}@);
 \end{itemdecl}\color{black}
@@ -2581,7 +2586,7 @@
 \index{partial_sort_copy@\tcode{partial_sort_copy}}%
 \color{addclr}\begin{itemdecl}
 template<InputIterator InIter, RandomAccessIterator RAIter>
- requires HasCopyAssign<RAIter::reference, InIter::value_type> &&
+ requires Has@\removedCCC{Copy}@Assign<RAIter::reference, InIter::@\changedCCC{value_type}{reference}@> &&
            @\changedCCC{SwappableIterator<RAIter>}{Swappable<RAIter::reference>}@ &&
            HasLess<InIter::value_type, RAIter::value_type> &&
            HasLess<RAIter::value_type, InIter::value_type> &&
@@ -2590,7 +2595,7 @@
                            RAIter @\farg{result_first}@, RAIter @\farg{result_last}@);
 
 template<InputIterator InIter, RandomAccessIterator RAIter, class Compare>
- requires HasCopyAssign<RAIter::reference, InIter::value_type> &&
+ requires Has@\removedCCC{Copy}@Assign<RAIter::reference, InIter::@\changedCCC{value_type}{reference}@> &&
            @\changedCCC{SwappableIterator<RAIter>}{Swappable<RAIter::reference>}@ &&
            Predicate<Compare, InIter::value_type, RAIter::value_type> &&
            Predicate<Compare, RAIter::value_type, InIter::value_type> &&

Modified: sandbox/committee/concepts/stdlib/lib-issues.txt
==============================================================================
--- sandbox/committee/concepts/stdlib/lib-issues.txt (original)
+++ sandbox/committee/concepts/stdlib/lib-issues.txt 2008-06-26 18:45:05 EDT (Thu, 26 Jun 2008)
@@ -43,7 +43,7 @@
      (Doug's reply: we agreed on the -lib reflector to have MoveConstructible+MoveAssignable+Swappable requirements for most algorithms, to give implementors more lattitude.)
 
 25.2.11
-y - Should we s/InIter::value_type/InIter::reference/ for rotate_copy.
+Y - Should we s/InIter::value_type/InIter::reference/ for rotate_copy.
 
 25.2.12
 y - random_shuffle third overload not finished.
@@ -68,10 +68,13 @@
 
 First overload
 
-y - s/Iter::value_type/Iter::reference/g
+Y - s/Iter::value_type/Iter::reference/g
     (Doug: this only applies to the HasCopyAssign, which will actually be a HasAssign)
  - Do we need HasLess 1 & 2 ? gcc does not have 2
- (Doug: I'm undecided; do implementors need this freedom? In reality, we might just want to force the value_types to be the same. This routine is insane without that requirement.)
+ (Doug: I'm undecided; do implementors need this freedom? In
+ reality, we might just want to force the value_types to be the
+ same. This routine is insane without that requirement.)
+ (Mat: in that case, is it worth rasing the bar to LessThanComparable?)
 N - partial_sort_copy single parameter HasLess requirement to be replaced with LessThanComparable concept.
 N - Add Requirements clause:
      *in < *res == RAIter::reference(*in) < *res
@@ -81,10 +84,11 @@
 
 Second overload
 
-y - s/Iter::value_type/Iter::reference/g
+Y - s/Iter::value_type/Iter::reference/g
    (Doug: again, only for the HasCopyAssign)
  - Do we need Predicate 1 & 2 ?
    (Doug: only if implementors need this freedom.)
+ (Mat: if not could we use StrictWeakOrder?)
 Y - partial_sort_copy two parameter Predicate requirement to be replaced with StrictWeakOrdering concept.
 N - Add Requirements clause:
      comp(*in, *res) == comp(RAIter::reference(*in), *res)
@@ -224,7 +228,8 @@
     result_type T::operator=(U);
   }
 
-Y = - Fix references to HasCopy/HasMoveAssign
+y = - Fix references to HasCopy/HasMoveAssign (first pass complete for
+algorithms. some work remains for iters and utils)
 
 =================================
 2006/06/12
@@ -295,7 +300,7 @@
 24.1/3
 
 Y - Replace nine iterator concepts -> several iter concepts
-y - Remove swappable iterators (Do this everywhere)
+Y - Remove swappable iterators (Do this everywhere)
 
 24.1.2
 


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