17 Smaller but Handy C++17 Features--Bartlomiej Filipek

It's not all about the big things.

17 Smaller but Handy C++17 Features

by Bartlomiej Filipek

From the article:

When you see an article about new C++ features, most of the time you’ll see a description of major elements. Looking at C++17, there are a lot of posts (including articles from this blog) about structured bindings, filesystem, parallel algorithms, if constexpr, std::optional, std::variant… and other prominent C++17 additions.

But how about those smaller parts? Library or language improvements that didn’t require decades to standardise or violent “battles” at the ISO meetings.

In this article, I’ll show you 17 smaller C++17 things that will improve your code...

Combining Ranges and Smart Output Iterators--Jonathan Boccara

And the next one.

Combining Ranges and Smart Output Iterators

by Jonathan Boccara

From the article:

In our current stage of development of smart output iterators, we have:

  • some iterators, such as filter, transform, unzip or demux,
  • the possibility to combine them: filter(pred) >>= transform(f) >>= unzip(back_inserter(output1), back_inserter(output2))
  • their usage as the output iterator of an STL algorithm:
std::copy(begin(inputs), end(inputs), transform(f) >>= back_inserter(outputs));

What we’re going to work on today is removing the call to std::copy to have a pipeline made of output iterators only. And once we get such a pipeline, we will plug it to ranges, in order to benefit from the expressiveness of both ranges and smart output iterators, in the same expression...

Quick Q: When to use virtual destructors?

Quick A: When you might delete polymorphically.

Recently on SO:

When to use virtual destructors?

Virtual destructors are useful when you might potentially delete an instance of a derived class through a pointer to base class:

class Base
{
    // some virtual methods
};

class Derived : public Base
{
    ~Derived()
    {
        // Do some important cleanup
    }
};

Here, you'll notice that I didn't declare Base's destructor to be virtual. Now, let's have a look at the following snippet:

Base *b = new Derived();
// use b
delete b; // Here's the problem!

Since Base's destructor is not virtual and b is a Base* pointing to a Derived object, delete b has undefined behaviour...

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.