id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 2056,Please add support for built-in arrays to boost::swap,niels_dekker,joseph.gauterin,"Please add support for built-in array types to the {{{boost::swap}}} utility, currently located in the [http://svn.boost.org/svn/boost/sandbox/swap/ sandbox]. For example: {{{ T arr1[N]; T arr2[N]; // Should do an element-wise swap of arr1 and arr2: boost::swap(arr1, arr2); }}} When {{{boost::swap}}} would support arrays, swap functions for other Boost libraries could be implemented more easily, and more generically. For example, [http://www.boost.org/doc/libs/1_35_0/doc/html/boost/array.html#id263053-bb array::swap] could call {{{boost::swap}}}, instead of {{{std::swap_ranges}}}, to ensure that a custom swap of {{{array::value_type}}} would be called, whenever appropriate. It would also allow adding a swap function to [http://www.boost.org/libs/utility/value_init.htm value_initialized], calling {{{boost::swap}}}, without breaking code that had {{{value_initialized}}} wrapping an array. A similar request for {{{std::swap}}} has been well received by the Library Working Group of the C++ Standards Committee: [http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#809 LWG issue 809, std::swap should be overloaded for array types] But of course, it will still take a while before STL implementations will actually have such an {{{std::swap}}} overload. In the meantime, it would be helpful if Boost could already start supporting swapping arrays. This issue was discussed by David Abrahams, Howard Hinnant, Matt Calabrese, Frank Mori Hess, and me at the Boost Developers mailing list, [http://lists.boost.org/Archives/boost/2008/06/138753.php (utility/swap) Okay to add array support to Boost.Swap (sandbox/swap)? ]",Feature Requests,closed,To Be Determined,None,,Problem,fixed,utility sandbox,joseph.gauterin@… niels_dekker