Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r48768 - sandbox/committee/concepts/stdlib
From: dgregor_at_[hidden]
Date: 2008-09-13 09:45:21


Author: dgregor
Date: 2008-09-13 09:45:21 EDT (Sat, 13 Sep 2008)
New Revision: 48768
URL: http://svn.boost.org/trac/boost/changeset/48768

Log:
Add missing pair assignment operator
Text files modified:
   sandbox/committee/concepts/stdlib/clib-utilities.tex | 35 +++++++++++++++++++++++++++++------
   1 files changed, 29 insertions(+), 6 deletions(-)

Modified: sandbox/committee/concepts/stdlib/clib-utilities.tex
==============================================================================
--- sandbox/committee/concepts/stdlib/clib-utilities.tex (original)
+++ sandbox/committee/concepts/stdlib/clib-utilities.tex 2008-09-13 09:45:21 EDT (Sat, 13 Sep 2008)
@@ -78,6 +78,10 @@
   \tcode{HasBitAnd}, \tcode{HasBitOr}, \tcode{HasBitXor}.
 \item Fixed the requirements of some \tcode{pair} and \tcode{tuple}
   constructors, mainly for consistent use of \tcode{RvalueOf}.
+\item Add a missing pair assignment operator, \tcode{operator=(const
+ pair<U, V>\&)}. The operator is not present in the current working
+ paper, which means that one could end up moving from pair lvalues
+ (thanks to Alisdair Meredith for reporting this issue).
 \end{itemize}
 
 \end{titlepage}
@@ -384,10 +388,13 @@
           @\addedConcepts{\&\& ConstructibleWithAllocator<T2, Alloc, Args\&\&...>}@
     pair(allocator_arg_t, const Alloc& a, U&& @\farg{x}@, Args&&... @\farg{args}@);
 
+ @\addedConcepts{template<class U , class V>}@
+ @\addedConcepts{requires HasAssign<T1, const U\&> \&\& HasAssign<T2, const V\&>}@
+ @\addedConcepts{pair\& operator=(const pair<U , V>\& p);}@
   @\addedConcepts{requires MoveAssignable<T1> \&\& MoveAssignable<T2>}@ pair& operator=(pair&& p );
   template<class U , class V>
     @\addedConcepts{requires HasAssign<T1, RvalueOf<U>::type> \&\& HasAssign<T2, RvalueOf<V>::type>}@
- pair& operator=(pair<U , V>&& p );
+ pair& operator=(pair<U , V>&& p);
 
   @\addedConcepts{requires Swappable<T1> \&\& Swappable<T2>}@ void swap(pair&& p );
 };
@@ -594,6 +601,22 @@
 \end{itemdescr}
 
 \begin{itemdecl}
+@\addedConcepts{template<class U , class V>}@
+ @\addedConcepts{requires HasAssign<T1, const U\&> \&\& HasAssign<T2, const V\&>}@
+ @\addedConcepts{pair\& operator=(const pair<U , V>\& p);}@
+\end{itemdecl}
+
+\begin{itemdescr}
+\pnum
+\addedConcepts{\mbox{\effects}
+Assigns to \mbox{\tcode{first}} with \mbox{\tcode{\farg{p}.first}}
+and to \mbox{\tcode{second}} with \mbox{\tcode{\farg{p}.second}}.}
+
+\pnum
+\addedConcepts{\mbox{\returns} \mbox{\tcode{*this}}.}
+\end{itemdescr}
+
+\begin{itemdecl}
 @\addedConcepts{requires MoveAssignable<T1> \&\& MoveAssignable<T2>}@ pair& operator=(pair&& @\farg{p}@);
 \end{itemdecl}
 
@@ -1910,7 +1933,7 @@
 \index{plus@\tcode{plus}}%
 \begin{itemdecl}
 template <@\changedConcepts{class}{ReferentType}@ T> struct plus : binary_function<T,T,T> {
- @\addedConcepts{requires HasPlus<T> \&\& Convertible<T::result_type, T>}@
+ @\addedConcepts{requires HasPlus<T, T> \&\& Convertible<T::result_type, T>}@
     T operator()(const T& @\farg{x}@, const T& @\farg{y}@) const;
 };
 \end{itemdecl}
@@ -2843,10 +2866,10 @@
 \index{function objects!wrapper|)}%
 
 \section*{Acknowledgments}
-Daniel Kr\"ugler provided helpful comments and corrections to this
-proposal. Pablo Halpern provided simplifications to the \tcode{pair}
-and \tcode{tuple} constructors along with other helpful comments and
-corrections.
+Daniel Kr\"ugler and Alisdair Meredith provided helpful comments and
+corrections to this proposal. Pablo Halpern, Howard Hinnat, and Alan
+Talbot all provided simplifications to the \tcode{pair} and
+\tcode{tuple} constructors.
 
 \bibliographystyle{plain}
 \bibliography{local}


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