[libcxx-commits] [PATCH] D104760: [libcxx][NFC] removes `swap`'s dependency on `swap_ranges`
Christopher Di Bella via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Jun 22 21:59:21 PDT 2021
cjdb updated this revision to Diff 353848.
cjdb added a comment.
- removes forward declaration of `swap_ranges`
- fixes header mishap
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104760/new/
https://reviews.llvm.org/D104760
Files:
libcxx/include/type_traits
Index: libcxx/include/type_traits
===================================================================
--- libcxx/include/type_traits
+++ libcxx/include/type_traits
@@ -4190,11 +4190,6 @@
// swap, swap_ranges
-template <class _ForwardIterator1, class _ForwardIterator2>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
-_ForwardIterator2
-swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2);
-
#ifndef _LIBCPP_CXX03_LANG
template <class _Tp>
using __swap_result_t = typename enable_if<is_move_constructible<_Tp>::value && is_move_assignable<_Tp>::value>::type;
@@ -4221,7 +4216,8 @@
>::type
swap(_Tp (&__a)[_Np], _Tp (&__b)[_Np]) _NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
{
- _VSTD::swap_ranges(__a, __a + _Np, __b);
+ for (size_t __i = 0; __i != _Np; ++__i)
+ swap(__a[__i], __b[__i]);
}
template <class _ForwardIterator1, class _ForwardIterator2>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104760.353848.patch
Type: text/x-patch
Size: 939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210623/8466ec75/attachment.bin>
More information about the libcxx-commits
mailing list