Boost C++ Libraries: Ticket #2753: Please let array::swap call boost::swap, instead of std::swap_ranges https://svn.boost.org/trac10/ticket/2753 <p> The <code>swap</code> member function of <code>boost::array</code> is implemented by calling <code>std::swap_ranges</code>. Now I've looked into various STL implementations, and some of them have <code>swap_ranges</code> doing element-wise copying, even when the the element type has a custom <code>swap</code> function. So it appears be preferable to have <code>array::swap</code> call <code>boost::swap</code> instead, for each of its elements. </p> <p> The <a href="http://www.boost.org/libs/utility/swap.html">boost::swap utility</a>, provided by Joseph Gauterin, takes care of calling the appropriate custom <code>swap</code>, whenever found by argument-dependent lookup (ADL). Moreover, it also supports swapping built-in arrays. </p> <p> So please consider applying the attached patch. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2753 Trac 1.4.3 niels_dekker Thu, 12 Feb 2009 17:12:57 GMT attachment set https://svn.boost.org/trac10/ticket/2753 https://svn.boost.org/trac10/ticket/2753 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">array_swap_by_boost_swap.patch</span> </li> </ul> Ticket Steven Watanabe Tue, 19 May 2009 02:43:21 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2753#comment:1 https://svn.boost.org/trac10/ticket/2753#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed in <a class="changeset" href="https://svn.boost.org/trac10/changeset/53104" title="Use boost::swap instead of std::swap_ranges to enable ADL. Fixes #2753.">[53104]</a>. </p> Ticket niels_dekker Tue, 19 May 2009 08:13:48 GMT <link>https://svn.boost.org/trac10/ticket/2753#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2753#comment:2</guid> <description> <p> Hi Steven, Thank you for fixing the issue! </p> </description> <category>Ticket</category> </item> </channel> </rss>