ReSharper C++ 2021.2

Integriert Inlay-Hinweise für ausgeblendete Typkonvertierungen und erweitert die Unterstützung für Unreal Engine.
August 4, 2021
Neue Version

Funktionen

  • Type conversion hints
    • Added new inlay hints which make hidden type conversions visible in the editor, so that you are aware of their potential performance and correctness implications.
    • You will now see special icons for implicit conversions. Alternatively, you can choose to show the conversions as textual hints.
    • ReSharper C++ now displays hints for different kinds of class type conversions, including object copying, object initialization using converting constructors or aggregate initialization and calls to conversion operators.
    • You can also now enable hints for standard conversions between built-in types, for example, conversions between numeric types that might lose precision or change the signedness of the type.
  • Immutability inspections
    • Immutability-related analyses can help you keep your code more readable and correct. By adding two new inspections, ReSharper C++ now covers all the rules from the Constants and immutability section of the C++ Core Guidelines.
    • The first new inspection extends the immutability analysis for function parameters of reference and pointer types. ReSharper C++ will now notify you if you can pass a pointer or a reference to const, which guarantees that the function will not modify the corresponding function argument.
    • The second inspection suggests marking variables that can be evaluated at compile-time with constexpr, which can lead to faster performance and better compile-time checking.
  • Modernizing inspections - This release includes some new inspections to help you modernize your code.
    • Structured binding could be used instead of tie(..) - Since C++17, you no longer need to use std::tie() or boost::tie() for unpacking a tuple or a pair - structured binding declarations help you simplify your code.
    • Type trait can now be simplified using a template alias or a variable template - C++14 alias templates let you shorten C++11 type trait expressions.
    • std::size can now be used - This inspection suggests using std::size as a type-safe alternative to the error-prone C idiom for array size calculation.
    • Zero initialization can be used instead of memset - zero-initialization leads to more concise code and prevents various memset-related errors.
  • Inline Function refactoring - The new Inline Function refactoring lets you quickly replace a function call with the body of the function. ReSharper C++ will perform the necessary transformations, handle all the name conflicts and reformat the resulting code.
  • Coding assistance
    • By default, ReSharper C++ generates functions with empty bodies, but now you can specify whether the generated functions should throw an std::logic_error, return a default value or include uncompilable code. ReSharper C++ will also automatically call the base function from the body of an overriding function.
    • Added a new context action which lets you convert any string into a C++11 raw string literal, which is easier to read when the string literal contains special characters. The transformation works both ways, so you can convert a raw string literal into a regular string literal as well.
    • If you want to quickly consult cppreference.com about the details of a standard library class or function, you can now click Read more in the Quick Documentation pop-up (Ctrl+Shift+F1) to open the corresponding page in your browser.
    • When you press Backspace on an empty line or a line with whitespaces or tabs to the left of the caret, ReSharper C++ can now place the caret at the proper indent position instead of moving it back one position at a time.
  • Unreal Engine - ReSharper C++ now supports working with Unreal Engine 5 from both the Unreal Launcher and GitHub sources.
    • In the .Build.cs and .Target.cs files of an Unreal Engine project, ReSharper C++’s code completion now suggests the list of available modules and plugins.
    • After you’ve added a module or a plugin, the new inspection for missing dependencies will highlight any that must be referenced in the .uproject or .uplugin file. Use the accompanying quick-fix to add new modules and plugins to the project files with a single click.
    • When generating a definition of an overriding function, ReSharper C++ will now call the overridden function from the generated body using the idiomatic Super type alias.
    • Improved the performance and memory usage of a cold startup. ReSharper C++ now indexes the Unreal Engine codebase 10% faster.
  • Other changes
    • The bundled Clang-Tidy has been updated to Clang 12, adding new checks from the latest LLVM release. Its performance in complex files, particularly in C++20 projects has been improved.
    • Added a new inspection which warns you when you compare an unsigned expression with 0, which may cause an infinite loop or unreachable code.
Type conversion hints

ReSharper C++

Visual Studio-Erweiterung für die C++-Entwicklung.

Sie haben eine Frage?

Live-Chat mit unseren JetBrains-Lizenzierungs-Spezialisten.