From 2047b5ab50b0c6833091818578c2ce2486d53fe8 Mon Sep 17 00:00:00 2001 From: David Rees <770765+studgeek@users.noreply.github.com> Date: Wed, 7 Aug 2024 13:47:02 -0700 Subject: [PATCH] Explicitly define default ContiguousBuffer assign op Since code defines copy constructor it should also define the assignment operator (rule of three). This also stops -Wdeprecated-copy warnings in downstream clients. --- runtime/cpp/emboss_memory_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/cpp/emboss_memory_util.h b/runtime/cpp/emboss_memory_util.h index b1c45fa..09be2f1 100644 --- a/runtime/cpp/emboss_memory_util.h +++ b/runtime/cpp/emboss_memory_util.h @@ -411,9 +411,9 @@ class ContiguousBuffer final { // TODO(bolms): Update callers and remove this constructor. explicit ContiguousBuffer(::std::nullptr_t) : bytes_{nullptr}, size_{0} {} - // Implicitly constructs a ContiguousBuffer from an identical - // ContiguousBuffer. + // Implicitly construct or assign a ContiguousBuffer from a ContiguousBuffer. ContiguousBuffer(const ContiguousBuffer &other) = default; + ContiguousBuffer& operator=(const ContiguousBuffer& other) = default; // Explicitly construct a ContiguousBuffers from another, compatible // ContiguousBuffer. A compatible ContiguousBuffer has an