This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 7bef557  cppcheck: Removed problematic move operators for 
FixedBufferWriter.
7bef557 is described below

commit 7bef557ab8b46fa87eb8e9b4d9e906e3d6fd9145
Author: Alan M. Carroll <[email protected]>
AuthorDate: Tue Apr 23 02:33:31 2019 -0500

    cppcheck: Removed problematic move operators for FixedBufferWriter.
---
 include/tscore/BufferWriter.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/tscore/BufferWriter.h b/include/tscore/BufferWriter.h
index f5fce06..57b6c57 100644
--- a/include/tscore/BufferWriter.h
+++ b/include/tscore/BufferWriter.h
@@ -207,6 +207,9 @@ public:
 };
 
 /** A @c BufferWrite concrete subclass to write to a fixed size buffer.
+ *
+ * Copies and moves are forbidden because that leaves the original in a 
potentially bad state. An
+ * instance is cheap to construct and should be done explicitly when needed.
  */
 class FixedBufferWriter : public BufferWriter
 {
@@ -231,10 +234,8 @@ public:
 
   FixedBufferWriter(const FixedBufferWriter &) = delete;
   FixedBufferWriter &operator=(const FixedBufferWriter &) = delete;
-  /// Move constructor.
-  FixedBufferWriter(FixedBufferWriter &&) = default;
-  /// Move assignment.
-  FixedBufferWriter &operator=(FixedBufferWriter &&) = default;
+  FixedBufferWriter(FixedBufferWriter &&)                 = delete;
+  FixedBufferWriter &operator=(FixedBufferWriter &&) = delete;
 
   FixedBufferWriter(MemSpan &span) : _buf(span.begin()), 
_capacity(static_cast<size_t>(span.size())) {}
 

Reply via email to