]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
buffer: add noexcept to move, swap, clear
authorCasey Bodley <cbodley@redhat.com>
Sun, 8 Oct 2017 20:27:30 +0000 (16:27 -0400)
committerKefu Chai <kchai@redhat.com>
Tue, 15 May 2018 16:04:38 +0000 (00:04 +0800)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/buffer.cc
src/include/buffer.h

index 1a8e9123b6c9501e322e9926511f01e8f015bfab..c2d8d36357e472f20aed30e768e58ea64ec885fe 100644 (file)
@@ -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);
index e110b74b2c0c09d30e075059ac57b01d3edb1d21..41b69508675410eb8556294ad00e8c633111c57a 100644 (file)
@@ -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<ptr>& 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;