Subject: [Boost-bugs] [Boost C++ Libraries] #2753: Please let array::swap call boost::swap, instead of std::swap_ranges
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-12 17:12:14
#2753: Please let array::swap call boost::swap, instead of std::swap_ranges
--------------------------+-------------------------------------------------
Reporter: niels_dekker | Owner: no-maintainer
Type: Patches | Status: new
Milestone: Boost 1.39.0 | Component: array
Version: Boost 1.38.0 | Severity: Optimization
Keywords: |
--------------------------+-------------------------------------------------
The {{{swap}}} member function of {{{boost::array}}} is implemented by
calling {{{std::swap_ranges}}}. Now I've looked into various STL
implementations, and some of them have {{{swap_ranges}}} doing element-
wise copying, even when the the element type has a custom {{{swap}}}
function. So it appears be preferable to have {{{array::swap}}} call
{{{boost::swap}}} instead, for each of its elements.
The [http://www.boost.org/libs/utility/swap.html boost::swap utility],
provided by Joseph Gauterin, takes care of calling the appropriate custom
{{{swap}}}, whenever found by argument-dependent lookup (ADL). Moreover,
it also supports swapping built-in arrays.
So please consider applying the attached patch.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/2753> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC