summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-18 10:35:25 +0200
committerDavid Robillard <d@drobilla.net>2020-07-18 10:37:57 +0200
commit4d10fb549416791393adcf06bd19684123665b0d (patch)
tree222436943aff8a7152afe13bc8db32d722a4d068
parentcb1b1c5710d207376eee7bb4b9c894c80dd072b3 (diff)
downloadraul-4d10fb549416791393adcf06bd19684123665b0d.tar.gz
raul-4d10fb549416791393adcf06bd19684123665b0d.tar.bz2
raul-4d10fb549416791393adcf06bd19684123665b0d.zip
Implement Array move operators by hand
I'm not sure why Apple clang has a problem with this, but clang-tidy (rightly) warns about move operators that aren't noexcept, so just define them manually.
-rw-r--r--raul/Array.hpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/raul/Array.hpp b/raul/Array.hpp
index cac993d..ee50470 100644
--- a/raul/Array.hpp
+++ b/raul/Array.hpp
@@ -79,9 +79,18 @@ public:
}
}
- Array(Array<T>&& array) = default;
+ Array(Array<T>&& array) noexcept
+ : _size(array._size)
+ , _elems(std::move(array._elems))
+ {
+ }
- Array<T>& operator=(Array<T>&&) = default;
+ Array<T>& operator=(Array<T>&& array) noexcept
+ {
+ _size = array._size;
+ _elems = std::move(array._elems);
+ return *this;
+ }
Array(size_t size, const Array<T>& contents)
: _size(size)