ReSharper 2024.1 Help

Context actions for C++

ReSharper provides the following context actions for Cpp:

Name

Description

Add '= default' specifier to a function without definition

Marks a function without definition as defaulted

Add '= delete' specifier to a function without definition

Marks a function without definition as deleted

Add braces

Adds braces around the statement

Add 'pure' specifier to a virtual function without definition

Marks a virtual function without definition with a 'pure' specifier

Arrange cv-qualifiers

Arranges 'const' and 'volatile' qualifiers in a declaration according to the syntax style

Arrange 'virtual' and 'override' specifiers on an overriding function

Arrange 'virtual' and 'override' specifiers on an overriding function according to the syntax style

Change signature of the current function

Change signature of the current function

Convert #include directive from angle-bracket to quoted form

Convert #include directive from angle-bracket to quoted form

Convert #include directive from quoted to angle-bracket form

Convert #include directive quoted to angle-bracket form

Convert '?:' expression to 'if' statement

Converts a ternary conditional operator to an equivalent 'if' statement

Convert a type alias into a typedef declaration

Replaces a type alias with an equivalent typedef declaration

Convert a typedef declaration into a type alias

Replaces a typedef declaration with an equivalent type alias

Convert an enum to a scoped enum

Converts an unscoped enum to a scoped enum

Convert an enum to a string

Creates a function from a template that converts an enum to a string

For more information, refer to convert enum to string (generate enum-to-string helper).

Convert clause to parameter constraint

Convert requires-clause to template parameter constraint

Convert 'if' statement to '?:' expression

Converts an 'if' statement to an equivalent ternary conditional operator

Convert to nested namespace definition

Replaces a series of nested namespaces with a single namespace using the nested namespace definition syntax

Convert to nested namespaces

Replaces a nested namespace definition with a series of nested namespaces

Convert to non-raw string literal

Converts raw string literal to non-raw

Convert to raw string literal

Converts string literal to raw

Convert to regular return type

Converts a trailing return type into a regular return type in a function declaration

Convert to trailing return type

Converts a regular return type into a trailing return type in a function declaration

Create derived class

Creates a derived class

Create derived class

Creates a derived class

Create derived class

Creates a derived class

Create derived interface

Creates a derived interface

Create derived interface

Creates a derived interface

Create derived interface class

Creates a derived interface class

Create derived interface struct

Creates a derived interface struct

Create derived ref class

Creates a derived ref class

Create derived struct

Creates a derived struct

DeMorgan law

Replaces a conjunction or disjunction operation with its negated counterpart following the De Morgan's laws

Document entity

Generate documentation for a function, macro definition, namespace, class, enum, typedef, alias declaration, global variable, or a class member from a template

For more information, refer to document entity.

Extract method from selected code

Creates a new method from the selected expression or statements, and replaces the selection with the function call

Flip operator arguments

Flips left and right operands for selected operator, e.g. '0 == i' to 'i == 0'

Flip relational operator

Flips operands of binary relational operators

Format compound statement

Formats the compound statement under the caret

Generate case-stubs

Generates missing case statements for the given switch statement

For more information, refer to generate missing case statements.

Generate constructor

Generate constructor

Generate definition by declaration

Generate definition by declaration

Generate definitions by declarations

Generate definitions by declarations

Generate inline definition

Generate inline definition

Generate inline definitions by declarations

Generate inline definitions by declarations

Generate missing members

Generate missing members

Generate mock methods

Generate mock methods

Generate overriding members

Generates overriding members

Initialize field from constructor parameter

Initializes field from constructor parameter

Introduce field for the selected expression

Creates a new field for the selected expression

Introduce namespace alias for the selected namespace

Introduces a namespace alias for the selected namespace

Introduce typedef/type alias for the selected type

Introduces a typedef or a type alias for the selected type

Introduce using enum

Introduces a using enum declaration from an enumerator of a scoped enum

Introduce variable for the selected expression

Creates a new variable for the selected expression

Invert '?:' condition

Inverts guard condition of a ternary statement and swaps the branches' code accordingly

Invert 'if' statement

Inverts guard condition of an 'if' statement and swaps the branches' code accordingly

Join declarations

Joins several declarations into a declaration with multiple declarators

Make member initializer a default member initializer

Moves member initializer from member initializer list to the default member initializer

Merge nested 'if' statements

Merges two nested 'if' statements to a single 'if' statement that checks conjunction of the original conditions

Move constraint to requires-clause

Move template parameter constraint to requires-clause

Move function definition out of class scope

Moves function definition out of class scope

For more information, refer to move implementation out of class scope.

Move function definition to source file

Moves function definition to a source file

Move function definitions

Move function definitions

Negate logical expression

Negates logical expression

Remove braces

Removes unnecessary braces around one or more statements in the code

Replace 'auto' with explicit type declaration

Replaces 'auto' with explicit type declaration

Replace decltype

Replaces decltype with the underlying type

Replace 'decltype(auto)' with explicit type declaration

Replaces 'decltype(auto)' with explicit type declaration

Replace explicit type with 'auto'

Replaces an explicit type in a variable declaration with 'auto'

Replace slashes in an include file path

Replaces slashes in an include file path according to the syntax style

Replace UNREFERENCED_PARAMETER to [[maybe_unused]]

Replace macro UNREFERENCED_PARAMETER to attribute [[maybe_unused]]

Sort #include directives

Sorts #include directives

Sort member initializers by the order of initialization

Sorts member initializers in an initializer list by the order of initialization

Specify template arguments explicitly

Specifies template arguments explicitly

Split declaration and assignment

Splits a declaration with an assignment into two separate statement

Split declaration with multiple declarators

Splits declaration containing multiple declarators into multiple declarations

Substitute macro call

Substitutes macro call

Substitute macro call with all nested calls

Substitutes macro call with all nested calls

Substitute template type alias

Replaces template type alias with the underlying type

Substitute typedef

Replaces typedef with the underlying type

Substitute typedef and all nested typedefs

Replaces typedef and all nested typedefs with the underlying type

Switch between typename and class keywords

Replaces typename with class and vice versa in template parameter definition

Last modified: 11 February 2024