Use dtor + placement new in assignment operator.

The change was used to simplify the code. A member was not copied and
that was noticed by cppcheck.
This commit is contained in:
Mark de Wever 2014-04-12 20:38:54 +02:00
parent 35f0d72454
commit b099e7c752

View File

@ -60,11 +60,8 @@ map_labels::~map_labels()
map_labels& map_labels::operator=(const map_labels& other)
{
if(this != &other) {
team_ = other.team_;
config cfg;
other.write(cfg);
read(cfg);
this->~map_labels();
new (this) map_labels(other);
}
return *this;
}