C++ keywords completion

Last modified: 26 May 2024

CLion uses Clangd code snippets in C++ keywords completion. The snippets work similarly to live templates: when you start typing a keyword, you can select the snippet from the completion list and use to move between stubs.

Find the full list of the currently available snippets here. A few examples are given below:

  • For the typedef keyword, completion suggests not only the keyword itself but also stubs for the type and the new name.

    https://resources.jetbrains.com/help/img/idea/2024.3/cl_typedef_snippets.png
    Gif
  • For namespace, CLion suggests several snippets that you can select from depending on the use case.

    https://resources.jetbrains.com/help/img/idea/2024.3/cl_namespace_snippets.png
    Gif
  • Also, there are sets of snippets for templates and C++ concepts. For example, here is how you can quickly define a new concept in your code:

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