ReSharper C++ Features

ReSharper C++ makes Visual Studio a better IDE for C++ developers, providing on-the-fly code analysis, quick-fixes, powerful search and navigation, smart code completion, refactorings, a variety of code generation options and other features to help increase your everyday productivity.

Code Analysis

ReSharper C++ starts analyzing code as soon as you open your project in Visual Studio editor, and keeps reanalyzing files as you edit them, detecting errors and possible problems before you even compile.

  • Generate default case
  • Create & initialize field
  • Add #include
Quick-fix to generate a missing switch default case
Create and initialize field from constructor parameter
Add missing include directives with ReSharper C++


40+ quick-fixes are available to instantly solve many of the detected code issues. Whenever you see a light bulb to the left of your code, press Alt+Enter to apply a suggested quick-fix.

For example, when an uninitialized variable is detected, you can immediately initialize it with the default value. Other quick-fixes let you add missing #include directives, or remove redundant qualifiers in a particular statement, or in a larger scope such as a file or even the entire solution.

Generating code from usage in ReSharper C++

Create from usage

Another benefit of quick-fixes is that you can start using classes, methods, variables, properties and fields before you declare them. When ReSharper C++ detects an undeclared symbol, it suggests quick-fixes to generate the corresponding symbol declaration based on its usage.

Find code issues

Find code issues

For any given scope such as a file, project or solution, you can tell ReSharper C++ to display all code issues that it detects in a dedicated tool window.

Find Code Issues works in the background, which lets you keep editing or navigating your code while ReSharper C++ runs its analysis and populates the Inspection Results tool window.

As soon as results are ready, you can group them by various criteria and search to find specific types of issues. You can also save and load reports of Find Code Issues results.


ReSharper C++ provides several full-scale, mainstream refactorings such as Rename, Extract Method and Change Signature. In addition, it offers dozens of context actions, which are local code transformations available with a single shortcut.

Rename refactoring in ReSharper C++


Modifying the name of a class or macro can cause many problems when performed manually. That's why, when you invoke the Rename refactoring, ReSharper C++ takes care of all the necessary checks.

Either all modifications are performed automatically, or you're shown a list of conflicts that you can resolve manually to be sure that only necessary and appropriate changes are made.

Along with actual code symbols that you apply it to, the Rename refactoring can rename related files (both the source file and the header file) and related text in comments and documentation, as well as update usages in #include directives.

Extract Method refactoring in ReSharper C++

Extract Method

The Extract Method refactoring helps you create a new method based on a selected code fragment. ReSharper analyses the selected block of code and detects variables that can be converted into method parameters or represent its return value.

Change Signature refactoring in C++

Change Signature

The Change Signature refactoring allows you to apply one or more changes to the signature of a function. All usages, implementations, and overrides of the function will be updated accordingly.

Inline Variable refactoring in C++

Introduce Variable and Inline Variable

The Introduce Variable refactoring allows you to create a new local variable based on a selected expression, initialize it with the expression, and finally replace all occurrences of the expression in the code with references to the newly introduced variable.

Conversely, Inline Variable replaces all occurrences of a given variable or local constant with its initializer.

Introduce Field refactoring in ReSharper C++

Introduce Field

The Introduce Field refactoring helps create a new field based on a selected expression, assign the original expression to the field in its own initializer or in the constructor, and replace occurrences.

  • Introduce namespace alias
  • Scope selection
Introduce Namespace Alias refactoring
Choosing occurrences to replace with Introduce Namespace Alias

Introduce Namespace Alias

The Introduce Namespace Alias refactoring helps define shortcut names for deeply nested namespaces.

As soon as you invoke the refactoring, it suggests defining a scope that you want to introduce a namespace alias for.

  • Specify type explicitly
  • Initialize field
  • Document method
Replace auto with explicit type in ReSharper C++
Merge nested 'if' statements in C++
Generating stubs for C++ documentation comments

Context actions

In addition to refactorings, ReSharper C++ provides a set of context actions: local code transformations that usually help switch between alternative syntax options. Similar to quick-fixes, they are made available when you press Alt+Enter.

For example, you can quickly replace auto with explicit type or replace type with auto. Other context actions help merge nested if statements, generate missing case statements when switching over an enum, substitute a macro call or typedef etc.

Coding Assistance

ReSharper C++ extends Visual Studio's ways of highlighting syntax and matching structural pieces of code, provides its own implementation of code completion, and helps visualize available documentation for any C++ symbol.

Auto-highlighting for exit points

Syntax and structure highlighting

ReSharper C++ recognizes *.c, *.cc, *.cxx, *.cpp, *.h, and *.hpp files in your solution, and highlights source code in these files according to a color scheme that you can modify at any time.

In addition, ReSharper C++ highlights various matching items when you place the caret at one item in a pair, be it matching delimiters, macros or a format specifier and argument in a printf function call.

When you put the caret on one of exit points from a function, loop or a switch statement (return, throw, break etc.), ReSharper C++ will now automatically highlight all other function or loop exits.

Auto-completion for C++ symbols not included in current file

Code completion

In C++ files, you can use code completion when writing your code, which sometimes suggests code generation options among other choices.

Code completion can even suggest symbols that are not yet included in the current file. When you select a symbol like this in the completion list, the corresponding #include directive is added automatically.

Quick Documentation pop-up

Documentation summary

Quick Documentation pop-up displays documentation based on Doxygen comment blocks without forcing you to navigate to a symbol's definition: just hit Ctrl+Shift+F1 in the default keymap.

Even if there is no Doxygen documentation available for a symbol, Quick Documentation will show the symbol's signature.

With ReSharper C++, finding your way through the source code gets a lot easier. Just search for declarations, members, method calls, or members of an inheritance hierarchy with simple shortcuts.

Navigate To menu in ReSharper C++

Contextual navigation

For all symbols that have separate declarations and definitions, ReSharper C++ displays the Navigate to declaration/definition icon on the left (Navigate to declaration/definition icon in ReSharper C++). Click the icon or press Ctrl+B to quickly switch between the declaration and the corresponding definition.

Other context-sensitive navigation options in ReSharper C++ include navigating from a selected symbol to its usages, base or derived symbols.

Context-insensitive navigation in ReSharper C++

Go to anything

ReSharper C++ offers a set of context-insensitive navigation commands including Go to File, Go to Symbol, Go to File Member and Go to Everything.

All these commands support lowerCamelCase-based search and filtering by path. For example, entering fc movie in the Go to Everything pop-up returns the list of files and file members that have the string movie in their names and that belong to either FollowerC project or FollowerConstants namespace (both matching fc).

  • Type hierarchy
  • Includes hierarchy
Type Hierarchy view in ReSharper C++
Includes Hierarchy view in ReSharper C++

Visualize hierarchies

ReSharper C++ can give you an overview of the inheritance hierarchy that any given type is a part of. You can see both base types and inheritors of the selected type and navigate to any of them in one click.

In addition, ReSharper C++ comes with a hierarchy view that serves to visualize and help you figure out dependencies introduced via #include directives.

Find usages of a symbol with ReSharper C++

Find usages

Use Find Usages to search for all references of a specific symbol in the C++ code of your solution.

As soon as search is completed, found occurrences are displayed in a tool window with grouping and filtering options, as well as a preview pane.

File Structure in C++

File structure

With ReSharper C++, you can view the structure of the current document using the File Structure window, which greatly simplifies navigation in large files.

As you switch to another editor tab, the tool window displays the structure of the corresponding file.

To-do Explorer in ReSharper C++

To-do Explorer

The To-do Explorer tool window lets you view, group and filter comments that contain one of the 3 default to-do patterns (Bug, Todo and Not Implemented) and any custom patterns that you might want to set up.

If you use the full ReSharper Ultimate license and you have a multilingual solution, the To-do Explorer will gather to-do items from all supported languages: C#, VB.NET, C++, JavaScript, XAML, HTML etc.

Code Generation

ReSharper C++ provides a variety of ways to generate boilerplate code. In addition to declaring and defining symbols based on their existing usages, it can create type members, surrounding code blocks, and any code snippets that you commonly need in your code base.

Code generation popup in ReSharper C++

Generate common code

ReSharper C++ offers a quick way to generate missing members, overriding members, equality or relational operators, definitions based on existing declarations, hash and swap functions and constructors.

Just press Alt+Ins in the text editor to invoke the Generate menu and see all available options.

Surround templates in ReSharper C++

Code and file templates

ReSharper C++ comes with 29 customizable templates. Some of them are regular code snippets, others are specifically used to wrap around code selections.

You can use and create file templates as well. Pressing Ctrl+Alt+Ins helps you quickly add a class to the project you're working on.

Code Style Assistance

With ReSharper C++, code formatter learns from your existing code, and your formatting and code style preferences can be shared with your team members.

Code style assistance in ReSharper C++

Code formatter

ReSharper C++ allows you to configure and apply code formatting rules that you prefer to use when working on a specific solution.

As an alternative to digging through all available code formatting options, you can select a block of code and configure only those that are applicable to this particular block.

Code style settings for default pointer initializer

Code style settings

To ensure a consistent code style across the entire team, you can save your formatting and naming preferences to a settings file and share it among your teammates.

ReSharper C++ also lets you define other parts of a team coding standard, such as the order of modifiers and the preferred value for pointer initializers. For example, you can specify 0, nullptr or NULL as the preferred initializer style, and ReSharper C++ will respect your choice when it generates new initializers for you.

Unit Testing

A Visual Studio-integrated unit test runner supports Google Test and Boost.Test frameworks.

  • Run tests from the editor
  • Explore tests
  • Manage sessions
Contextual unit testing commands
Unit Test Explorer for C++ tests
Unit testing with Google Test in ReSharper C++

Unit test runner

ReSharper C++ comes with a unit test runner in Visual Studio that supports Google Test and Boost.Test frameworks.

You can run and debug unit tests, as well as add tests to different sessions, right from the text editor, via the Alt+Enter contextual menu.

ReSharper C++ provides Unit Test Explorer and Unit Test Sessions tool windows to view, group, filter and run unit tests, as well as to create and manage unit test sessions.

Download ReSharper C++
Free 30-day trial