https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78231
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- 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://stackoverflow.com/questions/6380862/how-to-provide-a-swap-function-for-my-class http://stackoverflow.com/questions/11635172/how-to-implement-swap That doesn't work for iter_swap, for the reasons stated above: calls to iter_swap do not use ADL. It is not valid to add overloads of std::iter_swap, you can't add overloads to namespace std. You can specialize it as long as the specialization depends on at least one program-defined type. Please follow up in a more appropriate forum. GCC's library is doing the right thing, so this is not a bug. "How do I do ...?" does not belong in GCC's bugzilla.