mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-10 01:20:06 +00:00
fix: #192 quick fix by checking address
This commit is contained in:
parent
c1378cd3d1
commit
1400dd223f
@ -247,6 +247,7 @@ class basic_value
|
|||||||
}
|
}
|
||||||
basic_value& operator=(const basic_value& v)
|
basic_value& operator=(const basic_value& v)
|
||||||
{
|
{
|
||||||
|
if(this == std::addressof(v)) {return *this;}
|
||||||
this->cleanup();
|
this->cleanup();
|
||||||
this->region_info_ = v.region_info_;
|
this->region_info_ = v.region_info_;
|
||||||
this->comments_ = v.comments_;
|
this->comments_ = v.comments_;
|
||||||
@ -269,6 +270,7 @@ class basic_value
|
|||||||
}
|
}
|
||||||
basic_value& operator=(basic_value&& v)
|
basic_value& operator=(basic_value&& v)
|
||||||
{
|
{
|
||||||
|
if(this == std::addressof(v)) {return *this;}
|
||||||
this->cleanup();
|
this->cleanup();
|
||||||
this->region_info_ = std::move(v.region_info_);
|
this->region_info_ = std::move(v.region_info_);
|
||||||
this->comments_ = std::move(v.comments_);
|
this->comments_ = std::move(v.comments_);
|
||||||
|
Loading…
Reference in New Issue
Block a user