diff --git a/include/jsoncons/sink.hpp b/include/jsoncons/sink.hpp index 9802242c9f..934dce0504 100644 --- a/include/jsoncons/sink.hpp +++ b/include/jsoncons/sink.hpp @@ -41,6 +41,7 @@ class stream_sink // Noncopyable stream_sink(const stream_sink&) = delete; stream_sink& operator=(const stream_sink&) = delete; + stream_sink& operator=(stream_sink&&) = delete; public: stream_sink(stream_sink&&) = default; @@ -59,8 +60,6 @@ class stream_sink os_->flush(); } - stream_sink& operator=(stream_sink&&) = default; - void flush() { os_->write(begin_buffer_, buffer_length()); @@ -124,6 +123,7 @@ class binary_stream_sink // Noncopyable binary_stream_sink(const binary_stream_sink&) = delete; binary_stream_sink& operator=(const binary_stream_sink&) = delete; + binary_stream_sink& operator=(binary_stream_sink&&) = delete; public: binary_stream_sink(binary_stream_sink&&) = default; @@ -150,8 +150,6 @@ class binary_stream_sink os_->flush(); } - binary_stream_sink& operator=(binary_stream_sink&&) = default; - void flush() { os_->write((char*)begin_buffer_, buffer_length()); @@ -209,6 +207,7 @@ class string_sink // Noncopyable string_sink(const string_sink&) = delete; string_sink& operator=(const string_sink&) = delete; + string_sink& operator=(string_sink&& val) = delete; public: string_sink(string_sink&& val) : s_(nullptr) @@ -221,11 +220,6 @@ class string_sink { } - string_sink& operator=(string_sink&& val) - { - std::swap(s_, val.s_); - } - void flush() { } @@ -254,6 +248,7 @@ class bytes_sink // Noncopyable bytes_sink(const bytes_sink&) = delete; bytes_sink& operator=(const bytes_sink&) = delete; + bytes_sink& operator=(bytes_sink&&) = delete; public: bytes_sink(bytes_sink&&) = default; @@ -262,8 +257,6 @@ class bytes_sink { } - bytes_sink& operator=(bytes_sink&&) = default; - void flush() { } diff --git a/include/jsoncons/staj_reader.hpp b/include/jsoncons/staj_reader.hpp index e469ee9d4e..a4fabbabf1 100644 --- a/include/jsoncons/staj_reader.hpp +++ b/include/jsoncons/staj_reader.hpp @@ -867,7 +867,7 @@ class typed_array span data(uint64_array_arg_t) const { JSONCONS_ASSERT(type_ == typed_array_type::uint64_value); - span(data_.uint64_data_, size_); + return span(data_.uint64_data_, size_); } span data(int8_array_arg_t)