[Bug libstdc++/47433] libstdc++ parallel mode calls std::swap explicitely

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 24 14:03:00 GMT 2011


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



More information about the Gcc-bugs mailing list