Commit 1ec1b8d3 authored by Martin Heistermann's avatar Martin Heistermann

Use default copy constructors and assignment operators where possible

parent 6e975f10
Pipeline #13472 passed with stage
in 11 minutes and 8 seconds
...@@ -79,7 +79,11 @@ public: ...@@ -79,7 +79,11 @@ public:
// STL compliance (needs to have default constructor) // STL compliance (needs to have default constructor)
BaseIterator() : valid_(false), mesh_(nullptr) {} BaseIterator() : valid_(false), mesh_(nullptr) {}
BaseIterator(const BaseIterator& _c) = default;
virtual ~BaseIterator() = default; virtual ~BaseIterator() = default;
BaseIterator& operator=(const BaseIterator& _c) = default;
bool operator== (const BaseIterator& _c) const { bool operator== (const BaseIterator& _c) const {
return (this->cur_handle_ == _c.cur_handle() && return (this->cur_handle_ == _c.cur_handle() &&
this->valid_ == _c.valid() && this->valid_ == _c.valid() &&
...@@ -101,13 +105,6 @@ public: ...@@ -101,13 +105,6 @@ public:
return cur_handle_.idx() < _c.cur_handle_.idx(); return cur_handle_.idx() < _c.cur_handle_.idx();
} }
BaseIterator& operator=(const BaseIterator& _c) {
this->valid_ = _c.valid();
this->cur_handle_ = _c.cur_handle();
this->mesh_ = _c.mesh();
return *this;
}
operator bool() const { operator bool() const {
return valid_; return valid_;
} }
...@@ -189,6 +186,7 @@ public: ...@@ -189,6 +186,7 @@ public:
lap_(0), lap_(0),
max_laps_(1) max_laps_(1)
{} {}
BaseCirculator(const BaseCirculator& _c) = default;
virtual ~BaseCirculator() = default; virtual ~BaseCirculator() = default;
...@@ -208,13 +206,7 @@ public: ...@@ -208,13 +206,7 @@ public:
return lap_ < _c.lap_; return lap_ < _c.lap_;
} }
BaseCirculator& operator=(const BaseCirculator& _c) { BaseCirculator& operator=(const BaseCirculator& _c) = default;
BaseIter::operator=(_c);
this->ref_handle_ = _c.ref_handle();
this->lap_ = _c.lap_;
this->max_laps_ = _c.max_laps_;
return *this;
}
const IH& ref_handle() const { const IH& ref_handle() const {
return ref_handle_; return ref_handle_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment