https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
Jonathan Wakely changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
--- Comment #2 from Alfredo ---
@Jonathan, Can you link to the part of the line in the standard? I found that
standard to be very vague, for example in defining ValueSwappable. Is
ValueSwappable something that can be called with `std::iter_swap`,
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
--- Comment #3 from Jonathan Wakely ---
See 17.6.3.2 [swappable.requirements]. ValueSwappable is defined in terms of
swappable, which is defined in terms of swappable with, which is defined in
terms of an unqualified call to swap. It has nothing
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
--- Comment #4 from Alfredo ---
ok, thanks for the clarification.
So algorithms on iterators that swap use `::std::iter_swap`? (I didn't know
that.) That is step forward.
Is then one allowed to overload/specialize `std::iter_swap`? Just like o
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
--- Comment #5 from Jonathan Wakely ---
The correct way to implement swap for your own type is to overload it in your
type's namespace, and it will be found by ADL.
http://stackoverflow.com/questions/11562/how-to-overload-stdswap
http://stackover
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
Eric Niebler changed:
What|Removed |Added
CC||eric.niebler at gmail dot com
--- Comment
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
--- Comment #7 from Jonathan Wakely ---
(In reply to Eric Niebler from comment #6)
> Jonathan, the wording for std::reverse mentions iter_swap and doesn't seem
> to say whether it is called qualified or unqualified.
17.6.1.1 [contents] means it
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
--- Comment #8 from Jonathan Wakely ---
Also 17.6.5.4 [global.functions] p4.