This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/47433] libstdc++ parallel mode calls std::swap explicitely
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Jan 2011 13:53:29 +0000
- Subject: [Bug libstdc++/47433] libstdc++ parallel mode calls std::swap explicitely
- Auto-submitted: auto-generated
- References: <bug-47433-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47433
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-24 13:53:27 UTC ---
(In reply to comment #3)
> Is anything specified in the standard in this direction?
20.2.2 Swappable requirements [swappable.requirements]
3 The context in which swap(t, u) and swap(u, t) are evaluated shall ensure
that a binary non-member function named âswapâ is selected via overload
resolution (13.3) on a candidate set that includes:
â the two swap function templates defined in <utility> (20.3) and
â the lookup set produced by argument-dependent lookup (3.4.2).
The usual way to do that is:
using std::swap; // overloads in <utility> are candidates
swap(t, u); // overloads found by ADL are also candidates