Make json_iterator_ref unique

This commit is contained in:
John Keiser 2020-08-30 07:11:08 -07:00
parent 0ddff4ec7d
commit d5ecf68d26
1 changed files with 10 additions and 2 deletions

View File

@ -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<json_iterator_ref>(other).iter}
{
other.iter = nullptr;
}
simdjson_really_inline json_iterator_ref &json_iterator_ref::operator=(json_iterator_ref &&other) noexcept {
iter = std::forward<json_iterator_ref>(other).iter;
other.iter = nullptr;
return *this;
}
simdjson_really_inline json_iterator_ref::json_iterator_ref(json_iterator *_iter) noexcept
: iter{_iter}
{