Default constructor generator



while in Clion there is a shortcut to generate a default constructor, AFAIK there is nothing related to the other constructors (copy / copy assignment / move / move assignment / deconstructor). Obviously Clion could not implement any logic, but simply having the signature ready to me implemented would be a huge time saver. For instance, given the simplest class:

class A {}

this generator would create something like:

~A() {} // deconstructor
A& other) = default; // copy constructor
operator=(const A& other) = default; // copy assignment
A(A&& other) noexcept = default; // move constructor
operator=(A&& other) noexcept = default; // move assignment

That's a lot of boilerplate and fixed "formulas" to remember. A shortcut to generate them all, and leave them ready to be implemented / removed would save lots of time.


Please sign in to leave a comment.