Skip to content

Commit

Permalink
ムーブ後の JSON は JSON{} と同じ状態にする。
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Dec 30, 2023
1 parent 135b32a commit cf4c99b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Siv3D/src/Siv3D/JSON/SivJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ namespace s3d

JSON::JSON(JSON&& other)
: m_detail{ std::exchange(other.m_detail, std::make_shared<detail::JSONDetail>()) }
, m_isValid{ std::exchange(other.m_isValid, false) } {}
, m_isValid{ std::exchange(other.m_isValid, true) } {}

JSON::JSON(std::shared_ptr<detail::JSONDetail>&& detail)
: m_detail{ std::move(detail) } {}
Expand Down Expand Up @@ -547,7 +547,7 @@ namespace s3d
JSON& JSON::operator =(JSON&& other) noexcept
{
*m_detail = std::exchange(*other.m_detail, detail::JSONDetail{});
m_isValid = std::exchange(other.m_isValid, false);
m_isValid = std::exchange(other.m_isValid, true);
return *this;
}

Expand Down

0 comments on commit cf4c99b

Please sign in to comment.