CLion 2023.3 Help

Extract subclass

The Extract Subclass refactoring enables extracting certain members of a class into a subclass.

Extract a subclass

  1. Select the class members that you want to extract into a subclass.

  2. Choose Refactor | Extract/Introduce | Subclass from the main menu or the context menu.

  3. In the dialog that opens, set the name of the new subclass and select the members that you want to move there.

    Extract subclass
  4. Click Preview to check the refactoring result before proceeding. CLion will notify you in case of problems.

  5. Click Extract to proceed with the refactoring.

Last modified: 15 March 2024