mirror of
https://github.com/nlohmann/json
synced 2024-12-24 01:30:08 +00:00
removed move assignments from input adapters
This commit is contained in:
parent
7eadd6daef
commit
41b0704ce1
@ -43,7 +43,7 @@ class file_input_adapter
|
||||
file_input_adapter(const file_input_adapter&) = delete;
|
||||
file_input_adapter(file_input_adapter&&) = default;
|
||||
file_input_adapter& operator=(const file_input_adapter&) = delete;
|
||||
file_input_adapter& operator=(file_input_adapter&&) = default;
|
||||
file_input_adapter& operator=(file_input_adapter&&) = delete;
|
||||
|
||||
std::char_traits<char>::int_type get_character() noexcept
|
||||
{
|
||||
@ -85,6 +85,7 @@ class input_stream_adapter
|
||||
// delete because of pointer members
|
||||
input_stream_adapter(const input_stream_adapter&) = delete;
|
||||
input_stream_adapter& operator=(input_stream_adapter&) = delete;
|
||||
input_stream_adapter& operator=(input_stream_adapter&& rhs) = delete;
|
||||
|
||||
input_stream_adapter(input_stream_adapter&& rhs) : is(rhs.is), sb(rhs.sb)
|
||||
{
|
||||
@ -92,20 +93,6 @@ class input_stream_adapter
|
||||
rhs.sb = nullptr;
|
||||
}
|
||||
|
||||
input_stream_adapter& operator=(input_stream_adapter&& rhs)
|
||||
{
|
||||
if (is)
|
||||
{
|
||||
is->clear(is->rdstate() & std::ios::eofbit);
|
||||
}
|
||||
|
||||
is = rhs.is;
|
||||
sb = rhs.sb;
|
||||
rhs.is = nullptr;
|
||||
rhs.sb = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// std::istream/std::streambuf use std::char_traits<char>::to_int_type, to
|
||||
// ensure that std::char_traits<char>::eof() and the character 0xFF do not
|
||||
// end up as the same value, eg. 0xFFFFFFFF.
|
||||
@ -138,7 +125,7 @@ class input_buffer_adapter
|
||||
input_buffer_adapter(const input_buffer_adapter&) = delete;
|
||||
input_buffer_adapter& operator=(input_buffer_adapter&) = delete;
|
||||
input_buffer_adapter(input_buffer_adapter&&) = default;
|
||||
input_buffer_adapter& operator=(input_buffer_adapter&&) = default;
|
||||
input_buffer_adapter& operator=(input_buffer_adapter&&) = delete;
|
||||
|
||||
std::char_traits<char>::int_type get_character() noexcept
|
||||
{
|
||||
|
@ -3906,7 +3906,7 @@ class file_input_adapter
|
||||
file_input_adapter(const file_input_adapter&) = delete;
|
||||
file_input_adapter(file_input_adapter&&) = default;
|
||||
file_input_adapter& operator=(const file_input_adapter&) = delete;
|
||||
file_input_adapter& operator=(file_input_adapter&&) = default;
|
||||
file_input_adapter& operator=(file_input_adapter&&) = delete;
|
||||
|
||||
std::char_traits<char>::int_type get_character() noexcept
|
||||
{
|
||||
@ -3948,6 +3948,7 @@ class input_stream_adapter
|
||||
// delete because of pointer members
|
||||
input_stream_adapter(const input_stream_adapter&) = delete;
|
||||
input_stream_adapter& operator=(input_stream_adapter&) = delete;
|
||||
input_stream_adapter& operator=(input_stream_adapter&& rhs) = delete;
|
||||
|
||||
input_stream_adapter(input_stream_adapter&& rhs) : is(rhs.is), sb(rhs.sb)
|
||||
{
|
||||
@ -3955,20 +3956,6 @@ class input_stream_adapter
|
||||
rhs.sb = nullptr;
|
||||
}
|
||||
|
||||
input_stream_adapter& operator=(input_stream_adapter&& rhs)
|
||||
{
|
||||
if (is)
|
||||
{
|
||||
is->clear(is->rdstate() & std::ios::eofbit);
|
||||
}
|
||||
|
||||
is = rhs.is;
|
||||
sb = rhs.sb;
|
||||
rhs.is = nullptr;
|
||||
rhs.sb = nullptr;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// std::istream/std::streambuf use std::char_traits<char>::to_int_type, to
|
||||
// ensure that std::char_traits<char>::eof() and the character 0xFF do not
|
||||
// end up as the same value, eg. 0xFFFFFFFF.
|
||||
@ -4001,7 +3988,7 @@ class input_buffer_adapter
|
||||
input_buffer_adapter(const input_buffer_adapter&) = delete;
|
||||
input_buffer_adapter& operator=(input_buffer_adapter&) = delete;
|
||||
input_buffer_adapter(input_buffer_adapter&&) = default;
|
||||
input_buffer_adapter& operator=(input_buffer_adapter&&) = default;
|
||||
input_buffer_adapter& operator=(input_buffer_adapter&&) = delete;
|
||||
|
||||
std::char_traits<char>::int_type get_character() noexcept
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user