ASE: Explicitly write out Material move constructor and assignment operator

Because MSVC doesn't support defaulting them
pull/1732/head
Turo Lamminen 2018-01-24 12:25:30 +02:00
parent cbd7916ced
commit a8fd9f668f
1 changed files with 29 additions and 3 deletions

View File

@ -80,10 +80,36 @@ struct Material : public D3DS::Material
Material(const Material &other) = default;
Material(Material &&other) = default;
Material &operator=(const Material &other) = default;
Material &operator=(Material &&other) = default;
//! Move constructor. This is explicitly written because MSVC doesn't support defaulting it
Material(Material &&other)
: D3DS::Material(std::move(other))
, avSubMaterials(std::move(other.avSubMaterials))
, pcInstance(std::move(other.pcInstance))
, bNeed(std::move(other.bNeed))
{
other.pcInstance = nullptr;
}
Material &operator=(Material &&other) {
if (this == &other) {
return *this;
}
D3DS::Material::operator=(std::move(other));
avSubMaterials = std::move(other.avSubMaterials);
pcInstance = std::move(other.pcInstance);
bNeed = std::move(other.bNeed);
other.pcInstance = nullptr;
return *this;
}
~Material() {}