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

Extract lambda parameter

Last modified: 26 May 2024

The Extract Lambda Parameter refactoring helps you extract an expression or statement into a new parameter with a lambda expression passed as a corresponding argument. For example, this could be a comparator passed to a sorting function.

The following demo illustrates the usage of the Extract Lambda Parameter refactoring, as well as Extract Function, Extract Parameter, and Live Templates: