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

Unwrap and remove statements

Last modified: 08 October 2024

For C++, this refactoring safely unwraps if...else, for, while, do...while and try...catch control statements, or accurately removes enclosing parts of the nested statements.

Besides C++, the Unwrap/Remove action is available for:

Examples in different languages showing statements unwrapping:

https://resources.jetbrains.com/help/img/idea/2024.3/cl_unwrap_example.png
Gif