Early Access ProgramNews
A new CLion 2021.1 EAP build (211.6085.16) is now available from our website, via the Toolbox App, or as a snap package (if you are using Ubuntu). Note that if you are on macOS, there is a separate build for Apple Silicon (M1 chip).
C++ Clion G++
Today we are delighted to introduce postfix completion for C++ in CLion! Read on for more details.
Find the JetBrains CLion 2019.2 shortcut icon on your desktop. If there none, create a shortcut icon (with this name, or just CLion) on your desktop to the file C:/Program Files/JetBrains/CLion 2019.2/bin/clion64.exe. You will double-click this icon to start CLion (see the next section). Go to declaration, class, type or base symbol in one click. Search for all usages of a symbol throughout code, strings and comments. Instantly create constructors, missing members, equality, relational and stream output operators and override/implement functions. CMake is a meta build system that uses scripts called CMakeLists to generate build files for a specific environment (for example, makefiles on Unix machines). When you create a new CMake project in CLion, a CMakeLists.txt file is automatically generated under the project root. Let's start with creating a new CMake project. Postfix completion for C Postfix code completion lets you add code around an expression you've just typed. It can wrap an expression with a frequently used language construct, or pass the expression as the first argument of a free function. Postfix templates to wrap expressions with language constructs. CLion is one of the cross-platform support for IDE languages like C and C. Visual Studio is a complete feature, top IDE developed by MS for developing the latest web apps. 2 CLion can prove your creativity with smart and relevant code execution, quick navigation and reliable refactoring.
Postfix completion for C++
Postfix code completion lets you add code around an expression you've just typed. It can wrap an expression with a frequently used language construct, or pass the expression as the first argument of a free function.
Postfix templates to wrap expressions with language constructs
Postfix templates can help you with typical language constructs. Here's how you can use them:
- Type an expression and then a dot.
- After the dot, type the template abbreviation (postfix).
- Press the expansion key (it's Tab by default, but can be reconfigured in Settings/Preferences | Editor | General | Postfix Completion). Alternatively, simply select the abbreviation you need from the completion list that appears at step 2.
- The template expands and wraps your expression.
This is really useful especially when it comes to wrapping with a C++-style cast, make_shared
/make_unique
, various loops, begin
/end
idioms, and more:
The CLion 2021.1 EAP3 build ships with 20+ predefined templates, but unfortunately, you cannot define your own templates – for now. To find the list of abbreviations and the explanations of what the templates expand into, please go to Settings/Preferences | Editor | General | Postfix Completion. You can also enable or disable any templates from this list:
Postfix completion to pass the expression as the first argument of a free function
In this scenario, you can use postfix code completion to pass the expression you've just typed as the first argument to a free function. Here's how you can use it:
- Type an expression and then type a dot.
- CLion will suggest free functions that would accept the expression as the first parameter (taking ADL into account).
- After you select a function, the code is updated so that the expression is passed as the first argument.
C++ Clion Tutorial
- Type an expression and then type a dot.
- CLion will suggest free functions that would accept the expression as the first parameter (taking ADL into account).
- After you select a function, the code is updated so that the expression is passed as the first argument.
C++ Clion Tutorial
Do you think this postfix code completion can speed up your coding? What other postfix templates would you like to see in CLion? Let us know in the comments below!
Known issues are linked to this ticket CPP-4039. Feel free to submit a new report if you find any other problems.
This isn't the first build in our current EAP. Here is a short summary of the enhancements that have already been introduced in earlier 2021.1 EAP builds:
- Global Data Flow Analysis
- Google Sanitizers, Valgrind Memcheck, Code Coverage in remote mode
- Clazy analyzer in CLion
- Improvements to Makefile and CMake projects
This may also be a good time to mention Code With Me – our new service for remote collaborative development, which has recently added support for voice and video calls and is now in Beta. Learn more about Code With Me.
Clion For Linux
The full release notes are available here.
Mingw Clion
Your CLion team
JetBrains
The Drive to Develop Nabucco verdi.