[Boost-bugs] [Boost C++ Libraries] #2056: Please add support for built-in arrays to boost::swap

Subject: [Boost-bugs] [Boost C++ Libraries] #2056: Please add support for built-in arrays to boost::swap
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-06-29 17:35:42


#2056: Please add support for built-in arrays to boost::swap
------------------------------+---------------------------------------------
 Reporter: niels_dekker | Owner:
     Type: Feature Requests | Status: new
Milestone: To Be Determined | Component: None
  Version: | Severity: Problem
 Keywords: utility sandbox |
------------------------------+---------------------------------------------
 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<T>],
 calling {{{boost::swap<T>}}}, 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)? ]

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2056>
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:58 UTC