This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]