From 6b0e4195ebff10a7021eaf6b3f7c78abe30d0b75 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Tue, 22 Sep 2015 17:50:11 +0000 Subject: [PATCH] Change pair::swap(pair&) to call ADL swap instead of iter_swap; this fixes an obscure bug having to do with overloaded operator&. Fixes PR#24890 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@248304 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/utility | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/utility b/include/utility index 54cfc8bc1..8b982da72 100644 --- a/include/utility +++ b/include/utility @@ -388,8 +388,9 @@ struct _LIBCPP_TYPE_VIS_ONLY pair swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable::value && __is_nothrow_swappable::value) { - _VSTD::iter_swap(&first, &__p.first); - _VSTD::iter_swap(&second, &__p.second); + using _VSTD::swap; + swap(first, __p.first); + swap(second, __p.second); } private: