types: data_value: assert is_nothrow_move_constructible and assignable

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
This commit is contained in:
Benny Halevy
2026-02-12 11:59:01 +02:00
parent 8ccee6803e
commit afa438d60d
2 changed files with 6 additions and 2 deletions

View File

@@ -37,6 +37,7 @@
#include <boost/locale/encoding_utf.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <seastar/net/inet_address.hh>
#include <type_traits>
#include <unordered_set>
#include "utils/big_decimal.hh"
#include "utils/date.h"
@@ -55,6 +56,9 @@
#include "types/set.hh"
#include "types/listlike_partial_deserializing_iterator.hh"
static_assert(std::is_nothrow_move_constructible_v<data_value>);
static_assert(std::is_nothrow_move_assignable_v<data_value>);
static logging::logger tlogger("types");
bytes_view_opt read_collection_value(bytes_view& in);
@@ -3799,7 +3803,7 @@ data_value::data_value(const data_value& v) : _value(nullptr), _type(v._type) {
}
data_value&
data_value::operator=(data_value&& x) {
data_value::operator=(data_value&& x) noexcept {
auto tmp = std::move(x);
std::swap(tmp._value, this->_value);
std::swap(tmp._type, this->_type);

View File

@@ -261,7 +261,7 @@ public:
data_value(bool_class<Tag>);
data_value& operator=(const data_value&);
data_value& operator=(data_value&&);
data_value& operator=(data_value&&) noexcept;
const data_type& type() const {
return _type;
}