ReSharper C++
The Visual Studio Extension for C++ Development
ReSharper C++ 2023.1 EAP: Call Tracking and C++23 Features
The new Early Access build is here with the Incoming Calls hierarchy and support for the first set of C++23 features! Read on for more details and check out the full list of issues we’ve fixed in this update.
You can download the EAP builds from our website or via the Toolbox App.
Call tracking
ReSharper’s Call tracking has finally come to ReSharper C++! You can now view and navigate through call chains in the hierarchy of incoming calls. Just place the caret at any function and select Inspect->Incoming calls from the context menu or press Ctrl+Shift+Alt+A
to invoke it from the Inspect This menu.
In the call tracking results window, you can double-click the hierarchy entry to navigate to the corresponding call in the editor or expand any node to check out their incoming calls.
Tracking outgoing calls is currently not supported.
C++23 support
The February 2023 meeting of the C++ committee will be the last one dedicated to resolving C++23 issues, and technical work on C++23 will be completed. The new language standard brings a lot of interesting features, and ReSharper C++ 2023.1 is here to help you try them.
C++23 introduces a new way of declaring non-static member functions that allow deducing the type and value category of the class instance parameter. Why give it a try? Previously, you had to duplicate a function for a const
and non-const
overload, or even make 4 versions with different ref-qualifiers: &
, const&
, &&
, and const&&
. With C++23 deducing this
, you can handle all of these cases with just one function:
template <typename T> class optional_cpp20 { constexpr T& value() & { /* ... */ } constexpr T const& value() const& { /* ... */ } constexpr T&& value() && { /* ... */ } constexpr T const&& value() const&& { /* ... */ } // ... }; template <typename T> class optional_cpp23 { template <typename Self> constexpr auto&& value(this Self&& self) { /* ... */ } };
Check out the Deducing this (P0847) proposal for other use cases and new design patterns.
auto
is one of the easiest and most useful features in modern C++. C++23 introduces more ways to use it: auto(x)
and auto{x}
(P0849). With the new function-style auto
casting, you can make a decaying prvalue
copy of a variable to pass it as a function argument by value.
void pop_front_alike(Container auto& x) { std::erase(x.begin(), x.end(), auto(x.front())); }
Starting with this EAP build, ReSharper C++ is also aware of the following C++23 syntax updates:
- For C compatibility, labels are now allowed at the end of a compound statement (P2324).
- Empty parentheses
()
in lambdas are now optional in many cases (P1102).
Sort #includes alphabetically
We’ve introduced a new option to configure the sorting order for #include
directives. By default, all #include
s are sorted in the path order. If you prefer to see them in alphabetical order, you can now disable “Put files before folders”.
That’s all for now! Please try out the new build and share your feedback with us. If you encounter any issues, don’t hesitate to report them to our issue tracker.
Your ReSharper C++ team
JetBrains
The Drive to Develop