Extract typedef
The Extract Typedef refactoring changes the selected declaration of a type to a typedef
definition.
You can use Extract Typedef when the actual declaration is cumbersome, potentially confusing, or likely to vary from one implementation to another, or just to make code presentation more clear and readable.
Extract typedef in-place
In the editor, select the type declaration to be re-declared.
Call
from the main menu.If more than one occurrence of the selected expression is found, select Replace this occurrence only or Replace all occurrences in the Multiple occurrences found popup menu.
Specify the name of the new type.
CLion will extract the new
typedef
:
Before | After |
---|---|
void f(int);
void (*pf1)(int) = &f;
|
typedef void (*pFunction)(int);
void f(int);
pFunction pf1 = &f;
|
Last modified: 11 February 2024