Skip to content
Snippets Groups Projects
Commit 6ed79da6 authored by Yurov, Dmitry's avatar Yurov, Dmitry
Browse files

Assignment operators for Material

Redmine: #1858
parent f658fe81
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,12 @@ Material::Material(std::unique_ptr<BaseMaterialImpl> material_impl) ...@@ -12,6 +12,12 @@ Material::Material(std::unique_ptr<BaseMaterialImpl> material_impl)
: m_material_impl(std::move(material_impl)) : m_material_impl(std::move(material_impl))
{} {}
Material& Material::operator=(const Material& other)
{
m_material_impl.reset(other.m_material_impl->clone());
return *this;
}
Material Material::inverted() const Material Material::inverted() const
{ {
std::unique_ptr<BaseMaterialImpl> material_impl(m_material_impl->inverted()); std::unique_ptr<BaseMaterialImpl> material_impl(m_material_impl->inverted());
......
...@@ -43,6 +43,12 @@ public: ...@@ -43,6 +43,12 @@ public:
Material(std::unique_ptr<BaseMaterialImpl> material_impl); Material(std::unique_ptr<BaseMaterialImpl> material_impl);
#endif //SWIG #endif //SWIG
//! Material copy assignment
Material& operator=(const Material& other);
//! Material move assignment
Material& operator=(Material&& other) = default;
//! Constructs a material with inverted magnetization //! Constructs a material with inverted magnetization
Material inverted() const; Material inverted() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment