ReSharper C++ 2021.1 adds support for class types in non-type template parameters. With this C++20 feature, you can use your own classes in the types of template parameters when the class satisfies certain requirements.
Another useful addition is the support for C++20 CTAD rules: class template argument deduction now works for aggregate templates, type aliases, and inherited constructors.
Since C++17, the noexcept specification has been considered a part of the function type, and ReSharper C++ now fully supports the new exception specification semantics.
Up until now, code completion didn't include support for the C++20 coroutines-related syntax. Now
co_return are available both in basic code completion and as postfix completion templates.
ReSharper C++ will now notify you when a variable is declared before the scope in which it's used. In this case, you can use the provided quick-fix to move the variable and limit its scope.
Another new inspection detects redundant cast expressions, which can be safely eliminated from code without changing its semantics.
ReSharper C++ 2021.1 includes new quick-fixes for
errors: choose one of the conversions suitable for the current context (
to_string(), etc.) to resolve the error.
ReSharper C++ 2021.1 also highlights redundant template arguments that can be deduced by the language according to the C++17 class template argument deduction rules.
With the 2021.1 release, we've introduced a collection of syntax style settings that you can use to make ReSharper follow your chosen code style and enforce it throughout your entire codebase.
You can customize your syntax style preferences on the Code Editing | C++ | Syntax Style page. The selected option value will be used both for code generation and for code style enforcement.
ReSharper C++ will highlight style violations and offer you quick-fixes to help eliminate them. All syntax style quick-fixes can be applied in scope, including in local scopes like function bodies or class definitions.
Enabling all the style inspections can be overwhelming, so we've made sure that context actions are always available for tuning your code even if you’ve muted the corresponding inspections.
To enforce the chosen syntax style, you can use code cleanup or the dedicated Apply Syntax Style action, which will fix syntax style issues in the selection, the entire current file, or a set of files depending on the current context.
Several new syntax style settings let you configure and enforce the style of declarations in your code.
You can choose whether to prefer typedefs or use alias declarations instead. In function declarations, you can enforce trailing return types or configure ReSharper C++ to require regular return types. You can also specify whether to use C++17 nested namespace definitions where possible.
You can specify when ReSharper C++ should require
auto instead of an explicit type in variable declarations. By default,
auto is now suggested only when the deduced type is evident from the surrounding context.
Syntax style settings for the position of cv-qualifiers let you choose the east const or the west const style, and quickly update your code to use one or another.
You can also choose which of the
override specifiers (or both) should be used on
overriding functions and destructors.
In C++ braces can be omitted around single nested statements, but code style guidelines may still require braces in certain cases. To help you enforce the braces style, ReSharper C++ adds syntax style rules for the use of braces.
You can choose whether to always enforce braces, or you can require braces only for multi-line statements or around multi-line statement bodies. ReSharper C++ can also find and remove redundant braces that do not conform to the chosen braces style.
All the new syntax style checks have received a corresponding code cleanup option and can be disabled in custom profiles. There are also two new options to remove redundant casts and template argument lists.
The new Cleanup selection context action lets you quickly run code cleanup on the selected code range. You can also conveniently choose one of the custom code cleanup profiles to use during the run.
Finally, we've improved the performance of code cleanup. In many cases, code cleanup now spends less time analyzing code and performs fewer operations, finishing faster on real-world codebases.
We've introduced initial support for Unreal Engine 5 based on feedback from the Epic Games team.
Unreal Engine's Cast for type-safe dynamic casting is now available as a postfix template in code completion.
ReSharper C++ adds support for another Unreal Engine specific reflection macro,
RIGVM_METHOD, and now handles it correctly.
Take a look at What's New in ReSharper to learn about other changes coming to the ReSharper platform. For example, there is a new navigation action, Navigate to Windows Explorer, and an action for creating links to GitHub sources with the Copy FQN feature.
Free 30-day trial
ReSharper C++ 2020.3 provides seamless integration with UnrealHeaderTool to help you catch more issues with Unreal Engine class metadata right in the editor. When working with an Unreal Engine project, ReSharper C++ automatically runs UnrealHeaderTool on the file you’re editing and displays any errors or warnings, just like with other inspections. Watch the UnrealHeaderTool integration in action.
To always keep you up to date, ReSharper C++ now tracks Unreal Engine properties in real time and regenerates the project model as soon as you save any changes in .Build.cs, .Target.cs, .uproject, or .uplugin files.
ReSharper C++ 2020.3 improves its conformance to the Unreal Engine coding standard. For example,
ReSharper C++ now suggests using MoveTemp
(Unreal Engine's equivalent of
std::move) for casting to an rvalue reference.
ReSharper C++ 2020.3 fully supports C++20 comparison rules. This includes a significant change to how comparisons work, where the language is allowed to rewrite a comparison expression or reverse the order of arguments. You can now consult the tooltip to learn how an expression has been rewritten. When a comparison operator cannot be resolved, the error message will list all the considered overloading candidates.
Defaulted comparison operators are another addition to C++20. If you are not sure why a defaulted comparison operator in your class has been implicitly deleted, you can check the detailed tooltip message to find out the exact reason. ReSharper C++ can now also deduce the return type of a defaulted three-way comparison operator.
A new quick-fix lets you quickly add an
#include <compare> directive to
your source file, which is required whenever you use a three-way comparison operator that
returns a standard comparison category, such as
The Create operator from usage quick-fix has been updated to support C++20 comparison rules as well. You can now create both the member and the friend versions of an operator in addition to the non-member version. For secondary operators, which can be rewritten in terms of a primary one, you can choose to create either the primary or the secondary operator.
The full power of ReSharper's control-flow analysis now comes to HLSL shader files, including warnings about unreachable code, uninitialized variables, redundant control flow jumps and conditional branches, and much more.
ReSharper C++ 2020.3 offers two inspections with quick-fixes to help you adopt the new C++20 ranges library and modernize your code:
valuescan be used.
A new inspection suggests replacing usages of standard algorithms that accept a pair of iterators with equivalent algorithms that accept an iterator and a count where possible.
ReSharper C++ provides many kinds of inlay hints. While all of the hints are useful in certain scenarios, we’ve also heard feedback that sometimes they can be overwhelming. To help address this, we’ve come up with a new "Push-to-Hint" mechanism for inlay hints. In the Push-to-Hint visibility mode, hints are only shown when you either press and hold Ctrl, or press Ctrl twice.
We've made sure that the visibility mode can be configured separately for every kind of C++ inlay hint. You can quickly change the visibility mode for a given hint using the context menu, or head to the new option pages under Environment | Inlay Hints | C++ to check out all the settings.
A new context action helps you invert ternary operator expressions.
The "Join declaration and assignment" quick-fix is now available for cases when a local variable is reassigned in all paths before being read.
With import completion enabled, the completion list will suggest suitable members of incomplete classes from the header files that are not included in the current file.
Import completion now also suggests a new option to add an elaborated type specifier for the corresponding class, in addition to the options to add an include directive or a forward declaration.
We've improved argument code completion for library functions that accept macro constants. Library macro constants that are applicable to the current argument are now prioritized in the completion list. This heuristic works for functions from the standard library, WinAPI, and OpenGL.
In addition to its regular search, Find Text now performs a fuzzy search, which
means it takes possible typos and missing words into account. This feature can be very
helpful if you are looking for a certain format string used as an argument to a text
formatting function like
You can now use Go to Declaration to jump between matching preprocessor directives,
such as branches of a conditional preprocessing block, or the
#undef of the same macro in a single file.
Go to Declaration can also be used to quickly navigate to a base function – just
invoke it on an
Peek Implementations and Peek Base Symbols come to C++, allowing you to view and edit code in a popup window without switching away from the code you're writing.
For better readability, File Structure now uses the C++17 syntax for nested namespaces even if you have not yet adopted the new syntax in your codebase.
Go to Derived Symbols works for
set functions inside
C++/CLI properties and for
remove functions inside C++/CLI events.
Take a look at What's New in ReSharper to learn about other changes coming to the ReSharper platform. For example, command-line tools now support plugins, and you can invoke CleanupCode on a specific set of files or folders instead of the whole solution.
To increase the accuracy of auto-import and code completion, ReSharper C++ 2020.2 introduces support for the Unreal Engine project model. This means that ReSharper C++ is now able to read project information directly from .uproject files, without using the intermediary project files generated by Visual Studio. The new project model provides more refined lists of suggested items that depend on the plugin and module references. ReSharper C++ will also adjust its behavior when you switch the solution configuration.
ReSharper C++ will now also remind you to refresh your Visual Studio project in Unreal Editor if the project files are out of date.
For easier navigation, symbols from engine sources are now treated as library symbols and will be hidden by default from the search results if there is a matching symbol in user code.
To match the
Unreal Engine coding standard, ReSharper C++ 2020.2 includes several updates to
inspection severity, code generation actions, and auto-import of
Also, a new inspection with a quick-fix is
available for adding the
virtual specifier to overriding functions.
ReSharper C++ 2020.2 includes a lot of bug fixes and brings improved interoperation of C++/CLI with C#. When looking for derived symbols in C++/CLI code, ReSharper C++ finds symbols in C# code in addition to symbols in C++/CLI. Navigation to base and derived symbols also works on imported CLR entities.
New code inspections with quick-fixes are available for the
The following features have had their their scope and applicability extended:
ReSharper C++ can now automatically highlight usages of the element under the caret as you move through your code.
In the File Structure window, preprocessor directives are now hidden by default so you can navigate through large files more easily.
New inspections are available with corresponding quick-fixes that help you with the following cases:
gcnewon a native type and cannot use new on a managed type.
finalspecifier cannot be used for managed classes.
ReSharper C++ now also highlights spelling mistakes for preprocessor directives.
With a brief preview of Clang-Tidy quick-fixes, it's now easier to select the required fix option.
The evaluation engine has been updated with support for the modification of values inside
constexpr functions and can work with the values of class types.
A new completion item can insert an auto-generated lambda argument when a
std::function parameter is expected.
If a class is not included in the current file, import completion will suggest a new option to add a forward declaration instead of including the corresponding header file.
ReSharper C++ 2020.2 adds three new settings for more flexible configuration:
?:operator – a formatting option for multiline ternary expression.
//on Enter in multi-line // comments – an editor option to prevent the auto-extension of multi-line comments in single-line style.
#include ordering settings have been moved to a separate options page and are now
easier to find – just click Order of #includes under the Code Editing | C++
Last but not least, the formatting engine now works significantly faster in source files with many macro calls.
There are more updates from ReSharper itself. For example, code cleanup can now be launched automatically on save or applied only to the changed parts of recently modified files. You can learn more about these improvements here.