Recent Entries 2
- pattern critical 112d agoRule-of-Three becomes Rule-of-Five with C++11?So, after watching this wonderful lecture on rvalue references, I thought that every class would benefit of such a "move constructor", `template MyClass(T&& other)` edit and of course a "move assignment operator", `template MyClass& operator=(T&& other)` as Philipp points out in his answer, if it has dynamically allocated members, or generally stores pointers. Just like you should have a copy-ctor, assignment operator and destructor if the points mentioned before apply. Thoughts?
- pattern critical 112d agoWhat is The Rule of Three?- What does copying an object mean? - What are the copy constructor and the copy assignment operator? - When do I need to declare them myself? - How can I prevent my objects from being copied?