Skip to content

Commit

Permalink
Add a check for trivial_relocatability
Browse files Browse the repository at this point in the history
  • Loading branch information
mclow committed Oct 7, 2024
1 parent 1eb88fc commit f9c8b3d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libcxx/include/__algorithm/swap_ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ __swap_ranges(_ForwardIterator1 __first1, _Sentinel1 __last1, _ForwardIterator2
using _V2Type = iterator_traits<_ForwardIterator2>::value_type;
if constexpr(__libcpp_is_contiguous_iterator<_ForwardIterator1>::value &&
__libcpp_is_contiguous_iterator<_ForwardIterator2>::value &&
is_same_v<_V1Type, _V2Type> && is_replaceable_v<_V1Type>) {
is_same_v<_V1Type, _V2Type> &&
is_trivially_relocatable_v<_V1Type> && is_replaceable_v<_V1Type>) {
size_t __distance = distance(__first1, __last1);
if (__distance == 1) {
using std::swap;
Expand Down

0 comments on commit f9c8b3d

Please sign in to comment.