Extract define
Refactor | Extract/Introduce | Define
CtrlAlt0D
The Extract Define refactoring method defines the selected set of tokens as macro using #define
directive and replaces the set of tokens with macro call in the code.
In the editor, select the expression you want to replace with a macro call.
Press CtrlAlt0D or select Refactor | Extract/Introduce | Define from the main or context menu.
If there are several expressions available for extracting, select the required one from the list that opens and press Enter.
If more than one occurrence of the selected expression is found, CLion will suggest replacing all the occurrences or just the selected one. Select the desired option from the list that opens.
Select a name for the macro from the list of suggestions or type a new one.
Thanks for your feedback!