#2753 closed Patches (fixed)
Please let array::swap call boost::swap, instead of std::swap_ranges
Reported by: | niels_dekker | Owned by: | No-Maintainer |
---|---|---|---|
Milestone: | Boost 1.39.0 | Component: | array |
Version: | Boost 1.38.0 | Severity: | Optimization |
Keywords: | Cc: | niels_dekker |
Description
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 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.
Attachments (1)
Change History (3)
by , 14 years ago
Attachment: | array_swap_by_boost_swap.patch added |
---|
comment:1 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in [53104].