ReSharper C++ 2021.1

包括新的 C++20 和 C++17 語言功能,添加新的檢查,並改進了對虛幻引擎的支援。
4月 12, 2021 - 15:43


  • C++ Support
    • Added 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.
    • Added 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. ReSharper C++ now fully supports the new exception specification semantics.
    • Added support for the C++20 coroutines-related syntax. co_await, co_yield and co_return are available both in basic code completion and as postfix completion templates.
  • Code Analysis
    • 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.
    • Added new quick-fixes for conversion errors: choose one of the conversions suitable for the current context (c_str(), to_string(), etc.) to resolve the error.
    • ReSharper C++ now highlights redundant template arguments that can be deduced by the language according to the C++17 class template argument deduction rules.
  • Syntax Style - Added 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 Syntax Style page. The selected option value will be used both for code generation and for code style enforcement.
    • ReSharper C++ will now 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.
    • 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 now 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.
  • Declaration Style - 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 virtual and override specifiers (or both) should be used on overriding functions and destructors.
  • Braces style - 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.
  • Code Cleanup - 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.
    • 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.
  • Unreal Engine - Added 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.
ReSharper C++

ReSharper C++

用於 C++ 開發的 Visual Studio 擴展。


Live Chat現在與我們的JetBrains 專家即時聊天詢問。