From: Casey Bodley Date: Sun, 8 Oct 2017 20:27:30 +0000 (-0400) Subject: buffer: add noexcept to move, swap, clear X-Git-Tag: v14.0.0~97^2~6 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7688100840a517865e2799b78d854b881207df05;p=ceph-ci.git buffer: add noexcept to move, swap, clear Signed-off-by: Casey Bodley --- diff --git a/src/common/buffer.cc b/src/common/buffer.cc index 1a8e9123b6c..c2d8d36357e 100644 --- a/src/common/buffer.cc +++ b/src/common/buffer.cc @@ -929,7 +929,7 @@ public: return *this; } - void buffer::ptr::swap(ptr& other) + void buffer::ptr::swap(ptr& other) noexcept { raw *r = _raw; unsigned o = _off; @@ -1506,7 +1506,7 @@ public: // -- buffer::list -- - buffer::list::list(list&& other) + buffer::list::list(list&& other) noexcept : _buffers(std::move(other._buffers)), _len(other._len), _memcopy_count(other._memcopy_count), @@ -1515,7 +1515,7 @@ public: other.clear(); } - void buffer::list::swap(list& other) + void buffer::list::swap(list& other) noexcept { std::swap(_len, other._len); std::swap(_memcopy_count, other._memcopy_count); diff --git a/src/include/buffer.h b/src/include/buffer.h index e110b74b2c0..41b69508675 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -267,7 +267,7 @@ namespace buffer CEPH_BUFFER_API { bool have_raw() const { return _raw ? true:false; } raw *clone(); - void swap(ptr& other); + void swap(ptr& other) noexcept; ptr& make_shareable(); iterator begin(size_t offset=0) const { @@ -680,7 +680,7 @@ namespace buffer CEPH_BUFFER_API { _memcopy_count(other._memcopy_count), last_p(this) { make_shareable(); } - list(list&& other); + list(list&& other) noexcept; list& operator= (const list& other) { if (this != &other) { _buffers = other._buffers; @@ -690,7 +690,7 @@ namespace buffer CEPH_BUFFER_API { return *this; } - list& operator= (list&& other) { + list& operator= (list&& other) noexcept { _buffers = std::move(other._buffers); _len = other._len; _memcopy_count = other._memcopy_count; @@ -714,7 +714,7 @@ namespace buffer CEPH_BUFFER_API { unsigned get_memcopy_count() const {return _memcopy_count; } const std::list& buffers() const { return _buffers; } - void swap(list& other); + void swap(list& other) noexcept; unsigned length() const { #if 0 // DEBUG: verify _len @@ -744,7 +744,7 @@ namespace buffer CEPH_BUFFER_API { bool is_zero() const; // modifiers - void clear() { + void clear() noexcept { _buffers.clear(); _len = 0; _memcopy_count = 0;