From c4f779459732c68ef462b19f6580a5287e328133 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Thu, 9 Nov 2023 17:43:20 +0000 Subject: [PATCH] Fix ArrayStringParameters with move assignment/construction --- src/strings_internal.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/strings_internal.h b/src/strings_internal.h index ff520dc819..f8449ee4bb 100644 --- a/src/strings_internal.h +++ b/src/strings_internal.h @@ -203,13 +203,30 @@ public: */ template class ArrayStringParameters : public StringParameters { - std::array params = {}; ///< The actual parameters + std::array params{}; ///< The actual parameters public: ArrayStringParameters() { this->parameters = span(params.data(), params.size()); } + + ArrayStringParameters(ArrayStringParameters&& other) noexcept + { + *this = std::move(other); + } + + ArrayStringParameters& operator=(ArrayStringParameters &&other) noexcept + { + this->offset = other.offset; + this->next_type = other.next_type; + this->params = std::move(other.params); + this->parameters = span(params.data(), params.size()); + return *this; + } + + ArrayStringParameters(const ArrayStringParameters& other) = delete; + ArrayStringParameters& operator=(const ArrayStringParameters &other) = delete; }; /**