Default constructor generator
Answered
Hi,
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(const A& other) = default; // copy constructor
A& operator=(const A& other) = default; // copy assignment
A(A&& other) noexcept = default; // move constructor
A 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.
Hello!
Feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-2012. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.