Skip to content
Snippets Groups Projects
Commit debde989 authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[T] explicitly defined copy/move ctors and operators

parent 5feff47a
No related branches found
No related tags found
No related merge requests found
...@@ -53,9 +53,10 @@ class A : public InstanceCounter ...@@ -53,9 +53,10 @@ class A : public InstanceCounter
{ {
public: public:
A(const double value) : _value(value) {} A(const double value) : _value(value) {}
A(A const& other) : InstanceCounter(other), _value(other._value) {}
A(A const&) = default; A(A&& other) : InstanceCounter(std::move(other)), _value(other._value) {}
A(A&&) = default; A& operator=(A const& other) { _value = other._value; return *this; }
A& operator=(A&& other) { _value = other._value; return *this; }
void add(A const& other) { _value += other._value; } void add(A const& other) { _value += other._value; }
// pass by value intended. // pass by value intended.
......
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