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
llvm-svn: 248304
This commit is contained in:
parent
50534c2b6f
commit
0510a5adc8
|
@ -388,8 +388,9 @@ struct _LIBCPP_TYPE_VIS_ONLY pair
|
||||||
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
|
swap(pair& __p) _NOEXCEPT_(__is_nothrow_swappable<first_type>::value &&
|
||||||
__is_nothrow_swappable<second_type>::value)
|
__is_nothrow_swappable<second_type>::value)
|
||||||
{
|
{
|
||||||
_VSTD::iter_swap(&first, &__p.first);
|
using _VSTD::swap;
|
||||||
_VSTD::iter_swap(&second, &__p.second);
|
swap(first, __p.first);
|
||||||
|
swap(second, __p.second);
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue