CLion
 
Get CLion
Join the CLion 2025.1 Early Access Program and try out new features before they are released! Find out more

Extract function

Last modified: 05 December 2024

The following demo illustrates the usage of the Extract function refactoring, as well as Extract parameter, Extract lambda parameter, and Live templates:

When the Extract Function refactoring is invoked, CLion analyzes the selected block of code and detects variables that are the input for the selected code fragment and the variables that are output for it.

The detected output variable is used as a return value for the extracted function.