Can I format constructors, destructors, setters and getters generation in CLion?

Hello,

I've just recently installed CLion as I see is a very resourceful tool to write and refactor code for my University projects
However I do have an issue. I'm asked by my teachers to write only the declaration of class members in the .h file, and then write the definition of such members in the .cpp file. But I noticed CLion defines this members in the .h file so I wondered if there's any way to do this separately (so constructors, destructors, setters and getters declarations are in the .h, and definitions in the .cpp)?

Thank you very much in advance,

1 comment

Hi, Roberto!

Currently in 2016.1 CLion generates definitions for constructors, destructors, setters and getters inside class definition and they can be splitted with 'Move to source file/out of class' intention actions available by pressing Alt+Enter.

However right now we're working on changing logic for constructors/destructors/setters and getters generation, unifying it with whole user experience from 'Generate functions' (which inserts definition in current caret position) and probably will provide new logic soon (CPP-6053). 'Move to source file/out of class' intentions have also been reworked significantly (CPP-471).

All these changes are going to be available in the next 2016.2 version this Summer, EAP program is expected to be opened in May. Feel free to subscribe and upvote related tickets as well as leave your suggestions in comments.

1

Please sign in to leave a comment.