aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2021-01-02 12:34:12 -0800
committerDavid Tolnay <dtolnay@gmail.com>2021-01-02 12:34:12 -0800
commit8f68939ae9ed577aaac84902de3aba9ebdacd6cd (patch)
treeea4fe129537e2ccd0aa788273b6d55b07a5497a0 /include
parent2ae80499c114c08167d230521c81d870b32e9aec (diff)
downloadcxx-8f68939ae9ed577aaac84902de3aba9ebdacd6cd.tar.gz
Remove Str and Slice swaps
Diffstat (limited to 'include')
-rw-r--r--include/cxx.h15
1 files changed, 0 insertions, 15 deletions
diff --git a/include/cxx.h b/include/cxx.h
index 6c9a3a02..bb24b10d 100644
--- a/include/cxx.h
+++ b/include/cxx.h
@@ -106,8 +106,6 @@ public:
std::size_t size() const noexcept;
std::size_t length() const noexcept;
- void swap(Str &) noexcept;
-
// Important in order for System V ABI to pass in registers.
Str(const Str &) noexcept = default;
~Str() noexcept = default;
@@ -127,8 +125,6 @@ public:
bool operator>=(const Str &) const noexcept;
private:
- friend void swap(Str &lhs, Str &rhs) noexcept { lhs.swap(rhs); }
-
// Not necessarily ABI compatible with &str. Codegen will translate to
// cxx::rust_str::RustStr which matches this layout.
const char *ptr;
@@ -168,8 +164,6 @@ public:
std::size_t length() const noexcept;
bool empty() const noexcept;
- void swap(Slice &) noexcept;
-
T &operator[](std::size_t n) const noexcept;
T &at(std::size_t n) const;
T &front() const noexcept;
@@ -184,8 +178,6 @@ public:
iterator end() const noexcept;
private:
- friend void swap(Slice<T> &lhs, Slice<T> &rhs) noexcept { lhs.swap(rhs); }
-
// Not necessarily ABI compatible with &[T]. Codegen will translate to
// cxx::rust_slice::RustSlice which matches this layout.
void *ptr;
@@ -527,13 +519,6 @@ std::size_t Slice<T>::length() const noexcept {
}
template <typename T>
-void Slice<T>::swap(Slice<T> &rhs) noexcept {
- using std::swap;
- swap(this->ptr, rhs.ptr);
- swap(this->len, rhs.len);
-}
-
-template <typename T>
bool Slice<T>::empty() const noexcept {
return this->len == 0;
}