Extract function

Last modified: 14 February 2025

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.