diff --git a/src/generic/ondemand/json_iterator-inl.h b/src/generic/ondemand/json_iterator-inl.h index 42da13d7..dd8445d3 100644 --- a/src/generic/ondemand/json_iterator-inl.h +++ b/src/generic/ondemand/json_iterator-inl.h @@ -268,8 +268,16 @@ simdjson_really_inline json_iterator_ref json_iterator::borrow() noexcept { // json_iterator_ref // simdjson_really_inline json_iterator_ref::json_iterator_ref() noexcept = default; -simdjson_really_inline json_iterator_ref::json_iterator_ref(json_iterator_ref &&other) noexcept = default; -simdjson_really_inline json_iterator_ref &json_iterator_ref::operator=(json_iterator_ref &&other) noexcept = default; +simdjson_really_inline json_iterator_ref::json_iterator_ref(json_iterator_ref &&other) noexcept + : iter{std::forward(other).iter} +{ + other.iter = nullptr; +} +simdjson_really_inline json_iterator_ref &json_iterator_ref::operator=(json_iterator_ref &&other) noexcept { + iter = std::forward(other).iter; + other.iter = nullptr; + return *this; +} simdjson_really_inline json_iterator_ref::json_iterator_ref(json_iterator *_iter) noexcept : iter{_iter} {