ReSharper C++ 2019.2 has arrived with improved C++20 support, new code analysis checks, and more

Welcome ReSharper C++ 2019.2 release!

ReSharper C++ 2019.2: Faster indexing, improved C++20 support, new code analysis checks, and better Unreal Engine support

by Anastasia Kazakova

The new update brings:

  • 15-25% faster indexing on typical solutions like LLVM or Unreal Engine.
  • More sophisticated support for Unreal Engine (built-in documentation for reflection specifiers, RPC support in refactorings, specific UE4 code analysis checks).
  • More C++20 support (char8_t and conditional explicit support, pack expansion in lambda init-capture, default constructible and assignable stateless lambdas, and more).
  • Updates to built-in code analysis (new checks to catch unmatched preprocessor directive and redundant final function specifier in a final class).
  • Updates to code completion, navigation, and code formatter.
  • New code hints.

C++ Core Guidelines: Supporting Sections--Rainer Grimm

Table of contents.

C++ Core Guidelines: Supporting Sections

by Rainer Grimm

From the article:

Let's recapitulate. In the last two years, I have written about 100 posts to the C++ Core Guidelines. Why? The document answers:  "This document is a set of guidelines for using C++ well. The aim of this document is to help people to use modern C++ effectively.". But my story does not end here. The guidelines have a supporting section...

Presenter Interviews: Kate Gregory--Kevin Carpenter

Discover the person presenting at CppCon.

Presenter Interviews: Kate Gregory

by Kevin Carpenter

From the article:

In this week’s presenter interview, Kevin Carpenter welcomes back Kate Gregory to preview her upcoming talk Naming is Hard: Let’s Do Better. Kate’s talk will discuss how bad we as C++ developers can be when it comes to naming things and how we could improve.

Quick Q: Where and why do I have to put the “template” and “typename” keywords?

Quick A: to help the compiler understand what the programmer wants.

Recently on SO:

Where and why do I have to put the “template” and “typename” keywords?

In order to parse a C++ program, the compiler needs to know whether certain names are types or not. The following example demonstrates that:

t * f;

How should this be parsed? For many languages a compiler doesn't need to know the meaning of a name in order to parse and basically know what action a line of code does...

Getting Started with the PVS-Studio Static Analyzer for C++ Development under Linux

There are different ways to install PVS-Studio under Linux, depending on your distro type. The most convenient and preferred method is to use the repository, since it allows auto-updating the analyzer upon releasing new versions.

Getting Started with the PVS-Studio Static Analyzer for C++ Development under Linux

by Yuri Minaev

From the article:

Besides strace, you can base the analysis on the compile_commands.json (JSON Compilation Database) file. Many build systems have built-in means of exporting compilation commands, or you could use the BEAR utility to do this. Here's the command to launch the analysis in this case: pvs-studio-analyzer analyze –f /path/to/compile_commands.json

 

Quick Q: What are copy elision and return value optimization?

Quick A: optimisation compilers are allowed to do for perfomance.

Recently on SO:

What are copy elision and return value optimization?

Copy elision is an optimization implemented by most compilers to prevent extra (potentially expensive) copies in certain situations. It makes returning by value or pass-by-value feasible in practice (restrictions apply).

It's the only form of optimization that elides (ha!) the as-if rule - copy elision can be applied even if copying/moving the object has side-effects...

Enabling Polymorphism in SYCL using the C++ idiom "Curiously Recurring Template Pattern"

Dynamic polymorphism is a widely used C++ feature that allows code to be more flexible, and helps create easily extendable interfaces by overriding the base class specified interfaces inside our derived classes. However, in SYCL kernel code in order to emulate dynamic polymorphism we need to use some curious tricks and techniques.

Enabling Polymorphism in SYCL using the C++ idiom "Curiously Recurring Template Pattern"

by Georgi Mirazchiyski

From the article:

The CRTP idiom offers an alternative approach to polymorphism by providing us with the ability to specify static interfaces, where the base class specifies the the structure of the interface, while the derived one represents the implementation. In this case, the base class does represent the interface and the derived class represents the implementation — similar to the general idea of polymorphism.