[libcxx-commits] [PATCH] D69827: [libcxx] Remove swap for std::span

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 20 12:03:27 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG416b1560c597: [libcxx] Remove swap for std::span (authored by jdoerrie, committed by ldionne).
Herald added a project: libc++.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69827/new/

https://reviews.llvm.org/D69827

Files:
  libcxx/include/span


Index: libcxx/include/span
===================================================================
--- libcxx/include/span
+++ libcxx/include/span
@@ -343,13 +343,6 @@
     _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator        rbegin() const noexcept { return reverse_iterator(end()); }
     _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator          rend() const noexcept { return reverse_iterator(begin()); }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr void swap(span &__other) noexcept
-    {
-        pointer __p = __data;
-        __data = __other.__data;
-        __other.__data = __p;
-    }
-
     _LIBCPP_INLINE_VISIBILITY span<const byte, _Extent * sizeof(element_type)> __as_bytes() const noexcept
     { return span<const byte, _Extent * sizeof(element_type)>{reinterpret_cast<const byte *>(data()), size_bytes()}; }
 
@@ -509,17 +502,6 @@
     _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator        rbegin() const noexcept { return reverse_iterator(end()); }
     _LIBCPP_INLINE_VISIBILITY constexpr reverse_iterator          rend() const noexcept { return reverse_iterator(begin()); }
 
-    _LIBCPP_INLINE_VISIBILITY constexpr void swap(span &__other) noexcept
-    {
-        pointer __p = __data;
-        __data = __other.__data;
-        __other.__data = __p;
-
-        size_type __sz = __size;
-        __size = __other.__size;
-        __other.__size = __sz;
-    }
-
     _LIBCPP_INLINE_VISIBILITY span<const byte, dynamic_extent> __as_bytes() const noexcept
     { return {reinterpret_cast<const byte *>(data()), size_bytes()}; }
 
@@ -544,12 +526,6 @@
 -> enable_if_t<!is_const_v<_Tp>, decltype(__s.__as_writable_bytes())>
 { return __s.__as_writable_bytes(); }
 
-template <class _Tp, size_t _Extent>
-_LIBCPP_INLINE_VISIBILITY
-constexpr void swap(span<_Tp, _Extent> &__lhs, span<_Tp, _Extent> &__rhs) noexcept
-{ __lhs.swap(__rhs); }
-
-
 //  Deduction guides
 template<class _Tp, size_t _Sz>
     span(_Tp (&)[_Sz]) -> span<_Tp, _Sz>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69827.265318.patch
Type: text/x-patch
Size: 1973 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200520/9d95d6f9/attachment.bin>


More information about the libcxx-commits mailing list