Overload 159 is now available

ACCU’s Overload journal of October 2020 is out. It contains the following C++ related articles.

Overload 159 is now available

From the journal:

Virtual/Reality
By Frances Buontempo
Do we know what reality is? Frances Buontempo is no longer sure and now wonders if she’s a fictional character.

poly::vector – A Vector for Polymorphic Objects
By Ferenc Nándor Janky
Heterogeneous vectors can be slow. Janky Ferenc introduces a sequential container for storing polymorphic objects in C++.

Kafka Acks Explained
By Slanislav Kozlovski
Kafka’s configuration can be confusing. Slanislav Kozlovski helps us visualise this most misunderstood configuration setting.

Concurrency Design Patterns
By Lucian Tadu Teodorescu
Orchestrating concurrent tasks using mutexes is seldom efficient. Lucian Tadu Teodorescu investigates design patterns that help unlock concurrent performance.

C++ Modules: A Brief Tour
By Nathan Sidwell
C++20’s long awaited module system has arrived. Nathan Sidwell presents a tourist’s guide.

The Edge of C++
By Ferenc Deák
Everything has limits. Deák Ferenc explores the bounds of various C++ constructs.

Afterwood
By Chris Oldwood
Assume failure by default. Chris Oldwood considers various fail cases.

Quick Q: Why do I have to access template base class members through the this pointer?

Quick: in order to make x a dependent name, so that lookup is deferred until the template parameter is known

Recently on SO:

Why do I have to access template base class members through the this pointer?

If the classes below were not templates I could simply have x in the derived class. However, with the code below, I have to use this->x. Why?

template <typename T>
class base {

protected:
    int x;
};

template <typename T>
class derived : public base<T> {

public:
    int f() { return this->x; }
};

int main() {
    derived<int> d;
    d.f();
    return 0;
}

Dependency Injection with Boost.DI -- Richard Thomson

Utah C++ Programmers has released a video on dependency injection with the Boost.DI library.

Dependency Injection with Boost.DI

by Richard Thomson

From the video description:

Richard Thomson gives us a presentation on dependency injection in C++.  We'll look at dependency injection in general and then look at dependency injection using the Boost.DI library.

YouTube: https://www.youtube.com/watch?v=zMTAc8WHIgo

CopperSpice: What is Initialization

New video on the CopperSpice YouTube Channel:

What is Initialization

by Barbara Geller and Ansel Sermersheim

About the video:

In this video we look at some of the ways that variables are initialized in C++. We cover the various forms of initialization, the syntax used to specify them, and some of the corner cases that can occur. We also talk about the difference between initialization and initializers, and why being able to recognize an initializer is important for writing correct code.

Please take a look and remember to subscribe!

PVS-Studio 7.10 Release: OWASP, AUTOSAR, SARIF

We develop PVS-Studio not only as a classic code analyzer, but also in the direction of Security and Safety. In this regard, we've started working on the support of the OWASP and AUTOSAR C++14 standards. To facilitate PVS-Studio integration into other code quality control tools, we supported analyzer results conversion to the SARIF format.

PVS-Studio 7.10 Release: OWASP, AUTOSAR, SARIF

by Andrey Karpov

From the article:

Utilities for converting PVS-Studio analysis results (PlogConverter.exe for Windows and plog-converter for Linux\macOS) now support conversion to SARIF (Static Analysis Results Interchange Format). SARIF is a universal open format for presenting the results of tools that search for errors, safety and security defects. This format is supported by many static analyzers and allows you to combine various code quality control tools in a single ecosystem.

CLion 2020.3 EAP: Postmortem Debug With a Core File--Anastasia Kazakova

Are you using it?

CLion 2020.3 EAP: Postmortem Debug With a Core File

by Anastasia Kazakova

From the article:

In the previous 2020.3 EAP build we were focused on giving run/debug configurations and CMake profiles more flexibility in CLion, and at the same time we introduced a bundled tool for collaborative development and pair programming. In this EAP update we are adding one of the most long-awaited features in debugger – postmortem debug with a core file!

C++20 Modules Compiler Code Under Review, Could Still Land For GCC 11--Michael Larabel

Are you waiting for it?

C++20 Modules Compiler Code Under Review, Could Still Land For GCC 11

by Michael Larabel

From the article:

With C++20 one of the major features added is that of modules as a modern alternative to that of conventional C++ header files for packages. The C++20 modules code for the GNU Compiler Collection that has been in the works for several years is now under review and could potentially still land for the GCC 11 release next year...