ReSharper 2020.3 Help

Inlay Hints in C++

Parameter name hints

ReSharper C++: parameter name hints

Parameter name hints show the names of the members you are initializing and help disentangle complex aggregate initializations in C++17 and later:

ReSharper C++: parameter name hints in aggregate initialization

Parameter name hints are available in dependent code as well:

ReSharper C++: parameter name hints in dependent code

Namespace name hints

ReSharper: Inlay hints. Namespaces.

Preprocessor directive hints

Preprocessor directive hints help you quickly understand how conditional inclusions (#ifdef, #ifndef, #if, #endif, #else, and #elif) correspond to macro definitions:

ReSharper: Preprocessor directive hints in C++

Type name hints

Auto variables

This kind of hints is available for variables with automatically deduced type, which use the auto or decltype(auto) type specifiers. By default, the hint will be hidden if the deduced type is clear from the initializer expression, for example when the initializer is a constructor call, a constant, or an explicit cast.

ReSharper C++: type name hints for auto variables

Function and lambda return types

The return types of functions and lambdas can be automatically deduced from the return statement when they are omitted in the code:

ReSharper C++: type name hints for function and lambda return types

Structured bindings

In C++17’s structured binding declarations, type hints are especially useful since the type of a structured binding cannot be explicitly specified.

ReSharper C++: type name hints for structured bindings

Dependent code

Type hints also work for dependent code but note that they can affect the performance. In this case, disable the dependent code hints on the Environment | Inlay Hints | C++ | Type Name Hints page of ReSharper options (Alt+R, O).

ReSharper C++: type name hints for dependent code

Function calls

With the default settings, this kind of type hint is shown only after multiline chained member functions calls.

ReSharper C++: type name hints for functions calls

There are granular configuration options for the hints.

Last modified: 05 January 2021