add copy assigment overload
This commit is contained in:
parent
a6265a4442
commit
7a7b89ae67
2 changed files with 8 additions and 4 deletions
|
@ -4,9 +4,11 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
struct Example {
|
struct Example {
|
||||||
Example(); // constructor
|
Example(); // constructor
|
||||||
Example(const Example &); // copy constructor
|
virtual ~Example(); // destructor
|
||||||
virtual ~Example(); // destructor
|
|
||||||
|
Example(const Example &); // copy constructor
|
||||||
|
Example &operator=(const Example &); // copy assignement
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
Example::Example() { std::cout << "Hello, world!\n"; }
|
Example::Example() { std::cout << "Hello, world!\n"; }
|
||||||
|
|
||||||
|
Example::~Example() {}
|
||||||
|
|
||||||
Example::Example(const Example &) {}
|
Example::Example(const Example &) {}
|
||||||
|
|
||||||
Example::~Example() {}
|
Example &Example::operator=(const Example &src) { return *this; }
|
||||||
|
|
Loading…
Reference in a new issue