diff --git a/include/EASTL/algorithm.h b/include/EASTL/algorithm.h index 113e59c8..26e28e59 100644 --- a/include/EASTL/algorithm.h +++ b/include/EASTL/algorithm.h @@ -4084,12 +4084,10 @@ namespace eastl template ForwardIterator rotate_general_impl(ForwardIterator first, ForwardIterator middle, ForwardIterator last) { - using eastl::swap; - ForwardIterator current = middle; do { - swap(*first++, *current++); + eastl::swap(*first++, *current++); if(first == middle) middle = current; @@ -4100,7 +4098,7 @@ namespace eastl while(current != last) { - swap(*first++, *current++); + eastl::swap(*first++, *current++); if(first == middle) middle = current; diff --git a/include/EASTL/expected.h b/include/EASTL/expected.h index 7c58f2dd..5d8c6369 100644 --- a/include/EASTL/expected.h +++ b/include/EASTL/expected.h @@ -105,8 +105,7 @@ namespace eastl constexpr void swap(unexpected& other) noexcept(is_nothrow_swappable_v) { static_assert(is_swappable_v, "unexpected swap requires E to be swappable"); - using eastl::swap; - swap(mError, other.mError); + eastl::swap(mError, other.mError); }; friend constexpr void swap(unexpected& x, unexpected& y) noexcept(noexcept(x.swap(y))) @@ -638,12 +637,11 @@ namespace eastl is_nothrow_move_constructible_v && is_nothrow_swappable_v> EA_CPP20_CONSTEXPR void swap(expected& other) noexcept(NoExcept) { - using eastl::swap; if (other.mHasValue) { if (this->mHasValue) { - swap(this->mValue, other.mValue); + eastl::swap(this->mValue, other.mValue); } else { @@ -654,7 +652,7 @@ namespace eastl { if (!this->mHasValue) { - swap(this->mError, other.mError); + eastl::swap(this->mError, other.mError); } else // `other` has an error and `this` has a value, we need to swap them around. { @@ -1322,7 +1320,6 @@ namespace eastl bool NoExcept = is_nothrow_move_constructible_v && is_nothrow_swappable_v> EA_CPP20_CONSTEXPR void swap(expected& other) noexcept(NoExcept) { - using eastl::swap; if (other.mHasValue) { if (this->mHasValue) @@ -1338,7 +1335,7 @@ namespace eastl { if (!this->mHasValue) { - swap(this->mError, other.mError); + eastl::swap(this->mError, other.mError); } else { diff --git a/include/EASTL/optional.h b/include/EASTL/optional.h index a66007dc..2563c8ac 100644 --- a/include/EASTL/optional.h +++ b/include/EASTL/optional.h @@ -801,8 +801,7 @@ namespace eastl } else if (engaged && other.engaged) { - using eastl::swap; - swap(**this, *other); + eastl::swap(**this, *other); } //else if (!engaged && !other.engaged) // no op diff --git a/include/EASTL/priority_queue.h b/include/EASTL/priority_queue.h index 61fafd74..41141a56 100644 --- a/include/EASTL/priority_queue.h +++ b/include/EASTL/priority_queue.h @@ -455,9 +455,8 @@ namespace eastl inline void priority_queue::swap(this_type& x) EA_NOEXCEPT_IF((eastl::is_nothrow_swappable::value && eastl::is_nothrow_swappable::value)) { - using eastl::swap; - swap(c, x.c); - swap(comp, x.comp); + eastl::swap(c, x.c); + eastl::swap(comp, x.comp); } diff --git a/include/EASTL/queue.h b/include/EASTL/queue.h index c59dd798..594e7a78 100644 --- a/include/EASTL/queue.h +++ b/include/EASTL/queue.h @@ -308,8 +308,7 @@ namespace eastl template void queue::swap(this_type& x) EA_NOEXCEPT_IF((eastl::is_nothrow_swappable::value)) { - using eastl::swap; - swap(c, x.c); + eastl::swap(c, x.c); } diff --git a/include/EASTL/segmented_vector.h b/include/EASTL/segmented_vector.h index 5c308ca7..48f49f79 100644 --- a/include/EASTL/segmented_vector.h +++ b/include/EASTL/segmented_vector.h @@ -739,17 +739,16 @@ namespace eastl void segmented_vector::swap(this_type& other) { - using eastl::swap; // // EASTL doesn't have allocator_traits it has the effective // behavior of propagate_on_container_swap = true for all // allocators. - swap(mAllocator, other.mAllocator); - swap(mFirstSegment, other.mFirstSegment); - swap(mLastSegment, other.mLastSegment); - swap(mFreeList, other.mFreeList); - swap(mInUseSegmentCount, other.mInUseSegmentCount); - swap(mFreeListSegmentCount, other.mFreeListSegmentCount); + eastl::swap(mAllocator, other.mAllocator); + eastl::swap(mFirstSegment, other.mFirstSegment); + eastl::swap(mLastSegment, other.mLastSegment); + eastl::swap(mFreeList, other.mFreeList); + eastl::swap(mInUseSegmentCount, other.mInUseSegmentCount); + eastl::swap(mFreeListSegmentCount, other.mFreeListSegmentCount); } template diff --git a/include/EASTL/stack.h b/include/EASTL/stack.h index d9264ca3..3b7839be 100644 --- a/include/EASTL/stack.h +++ b/include/EASTL/stack.h @@ -285,8 +285,7 @@ namespace eastl template void stack::swap(this_type& x) EA_NOEXCEPT_IF(eastl::is_nothrow_swappable::value) { - using eastl::swap; - swap(c, x.c); + eastl::swap(c, x.c); } diff --git a/include/EASTL/variant.h b/include/EASTL/variant.h index cc42dc76..1c24b6db 100644 --- a/include/EASTL/variant.h +++ b/include/EASTL/variant.h @@ -956,8 +956,7 @@ namespace eastl { using alternative_t = remove_reference_t; - using eastl::swap; - swap(thisAlternative, *other.template get_as()); + eastl::swap(thisAlternative, *other.template get_as()); }; visit(genericVisitor, *this); diff --git a/include/EASTL/vector_map.h b/include/EASTL/vector_map.h index 655470bd..23293e1c 100644 --- a/include/EASTL/vector_map.h +++ b/include/EASTL/vector_map.h @@ -483,8 +483,7 @@ namespace eastl vector_map::operator=(this_type&& x) { base_type::operator=(eastl::move(static_cast(x))); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); return *this; } @@ -503,8 +502,7 @@ namespace eastl inline void vector_map::swap(this_type& x) { base_type::swap(x); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); } diff --git a/include/EASTL/vector_multimap.h b/include/EASTL/vector_multimap.h index 85d48fca..b8ed9add 100644 --- a/include/EASTL/vector_multimap.h +++ b/include/EASTL/vector_multimap.h @@ -473,8 +473,7 @@ namespace eastl vector_multimap::operator=(this_type&& x) { base_type::operator=(eastl::move(x)); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); return *this; } @@ -493,8 +492,7 @@ namespace eastl inline void vector_multimap::swap(this_type& x) { base_type::swap(x); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); } diff --git a/include/EASTL/vector_multiset.h b/include/EASTL/vector_multiset.h index 49ab3475..113b563b 100644 --- a/include/EASTL/vector_multiset.h +++ b/include/EASTL/vector_multiset.h @@ -417,8 +417,7 @@ namespace eastl vector_multiset::operator=(this_type&& x) { base_type::operator=(eastl::move(x)); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); return *this; } @@ -437,8 +436,7 @@ namespace eastl inline void vector_multiset::swap(this_type& x) { base_type::swap(x); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); } diff --git a/include/EASTL/vector_set.h b/include/EASTL/vector_set.h index c51caf0e..e804a3cd 100644 --- a/include/EASTL/vector_set.h +++ b/include/EASTL/vector_set.h @@ -416,8 +416,7 @@ namespace eastl vector_set::operator=(this_type&& x) { base_type::operator=(eastl::move(x)); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); return *this; } @@ -436,8 +435,7 @@ namespace eastl inline void vector_set::swap(this_type& x) { base_type::swap(x); - using eastl::swap; - swap(static_cast(*this), static_cast(x)); + eastl::swap(static_cast(*this), static_cast(x)); }