How many default Constructors and Assignment Operators are there to "block"?
Example:
Am I missing any (and therefore is this correct?) Further, I realize that not all of these are necessary--for example, Obj(const Obj&) covers Obj(Obj&), but seeing as the compiler doesn't complain, it's easier for me to remember to block non-constant and constant for each type, and thus I recall all of these when I need to implement them.
Comments?
Example:
Code:
class Obj
{
public:
// Default constructor.
Obj(void);
// Destructor.
~Obj(void);
private:
// Copy constructors.
Obj(Obj&);
Obj(const Obj&);
// Move constructors (new in C++11).
Obj(Obj&&);
Obj(const Obj&&);
// Assignment operators.
Obj operator= (Obj&);
Obj operator= (const Obj&);
Obj operator= (Obj&&);
// Technically not necessary, as Move operations want to "reset" the
// object passed in as an argument?
Obj operator= (const Obj&&);
};
Am I missing any (and therefore is this correct?) Further, I realize that not all of these are necessary--for example, Obj(const Obj&) covers Obj(Obj&), but seeing as the compiler doesn't complain, it's easier for me to remember to block non-constant and constant for each type, and thus I recall all of these when I need to implement them.
Comments?