Boost logo

Boost-Commit :

From: joseph.gauterin_at_[hidden]
Date: 2007-10-03 07:50:31


Author: joseph.gauterin
Date: 2007-10-03 07:50:31 EDT (Wed, 03 Oct 2007)
New Revision: 39669
URL: http://svn.boost.org/trac/boost/changeset/39669

Log:
Clarified language regarding overloading std::swap vs specializing std::swap.
Text files modified:
   sandbox/swap/libs/utility/swap.html | 9 +++++++--
   1 files changed, 7 insertions(+), 2 deletions(-)

Modified: sandbox/swap/libs/utility/swap.html
==============================================================================
--- sandbox/swap/libs/utility/swap.html (original)
+++ sandbox/swap/libs/utility/swap.html 2007-10-03 07:50:31 EDT (Wed, 03 Oct 2007)
@@ -24,7 +24,7 @@
     <p>
       The generic <tt>std::swap</tt> function requires that the elements to be swapped are assignable and copy constructable. It is ususally implemented using one copy constuction and two assignments. This is often both unneccessarily restrictive and unneccessarily slow. In addition, specialized swap functions are often able to provide the no-throw exception guarentee where the generic swap implementation provides only the weak guarantee.</p>
     <p>
- The alternative to using argument dependent lookup in this situation is to overload std::swap for every type that requires a specialized swap. Although this is legal C++, no boost libraries use this method, whereas many boost libraries provide specialized swap functions in their own namespaces.
+ The alternative to using argument dependent lookup in this situation is to specialize std::swap for every type that requires a specialized swap. Although this is legal C++, no boost libraries use this method, whereas many boost libraries provide specialized swap functions in their own namespaces.
     </p>
     
     <!-- Requirements -->
@@ -36,8 +36,13 @@
     </ul>
     <p>Or:</p>
     <ul>
- <li>A function with the signature <tt>swap(T&,T&)</tt> is available via argument dependent lookup or such a function exists in namespace <tt>std</tt>.</li>
+ <li>A function with the signature <tt>swap(T&,T&)</tt> is available via argument dependent</li>
     </ul>
+ <p>Or:</p>
+ <ul>
+ <li>A template specialization of std::swap exists for T</li>
+ </ul>
+
     
     <!-- Portability -->
     <h2>Portability</h2>


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