CLion 2016.3 Help

Generating Definitions

When a function's declaration exists in a class or a namespace but has no implementation yet, you can create definition (implementation) for that function using the Generate definition feature.

Generating function's definition

To generate the function's definition:

  1. In the editor, place caret at the desired position.
  2. To access the Generate definition action, do one of the following:
    • On the main menu, choose Code | Generate or press Alt+Insert. In the dialog that opens select the Generate Definitions option.
    • Right-click the mouse and select Generate from the context menu. In the dialog that opens select the Generate Definitions option.
    • Press Ctrl+Shift+D.
      /help/img/idea/cl_GenerateDefinitionsPopup.png
  3. In the dialog box that appears, select the functions to generate definition for.
    /help/img/idea/cl_generateDefinitionsDialog.png
  4. Click OK to apply.
  5. The function's definition appears starting from the caret position. In case when the caret is placed inside a class, the functions body is added to the existing declarations.

See Also

Procedures:

External Links:

Last modified: 22 November 2016