Articles & Books

CppCon 2020 Trip Report--Conor Hoekstra

And another.

CppCon 2020 Trip Report

by Conor Hoekstra

From the article:

This was my second time attending CppCon. The first time I attended was in 2019, when I gave my first CppCon presentation in two parts, Algorithm Intuition - although I personally recommend the C++Now 2019 version which is 30 minutes shorter.

CppCon 2020 Trip Report--Shafik Yaghmour

And another.

CppCon 2020 Trip Report

by Shafik Yaghmour

From the article:

CppCon 2020 was online this year due to Covid-19. I was not sure what to expect from an online only conference. I had heard mildly positive feedback from recent online only conferences but this would be my first experience. For the most part the experience exceeded my expectations. There were were technical problems here and there but mostly it ran smoothly. It was fatiguing to watching videos for so long but since I was home I was able to stretch in between sessions and move around and that usually helped...

The last vestiges of object oriented programming -- Geoffrey Viola

A history, some negative examples, and some positive examples of using object oriented programming in C++.

The Last Vestiges of Object Orientated Programming

by Geoffrey Viola

From the article:

Object oriented programming is not as popular as it was. As with any programming language feature it can be abused. Multiple inheritance, long inheritance chains, and needless inheritance can add unnecessary complexity. There are few cases where it works well in C++: building product types, enforcing an invariant, and dynamic polymorphism. Generally, classes should follow one of these deliberately to follow the single responsibility principle, but there are exceptions.

Introduction to modern CMake for beginners

A look at one of the most popular build systems for C and C++.

Introduction to modern CMake for beginners

Internal Pointers

From the article:

CMake is a collection of open-source and cross-platform tools used to build and distribute software. In recent years it has become a de-facto standard for C and C++ applications, so the time has come for a lightweight introductory article on the subject.

Quick Q: Is std::unique_ptr required to know the full definition of T?

Quick A: For certain members only.

Recently on SO:

Is std::unique_ptr<T> required to know the full definition of T?

Most templates in the C++ standard library require that they be instantiated with complete types. However shared_ptr and unique_ptr are partial exceptions. Some, but not all of their members can be instantiated with incomplete types. The motivation for this is to support idioms such as pimpl using smart pointers, and without risking undefined behavior...

What std::exchange does, and how to remember it--Jonathan Boccara

If you had troubles.

What std::exchange does, and how to remember it

by Jonathan Boccara

From the article:

std::exchange was introduced in the C++ standard library in C++14 under the header <utility>.

Its name suggests that it’s a general-purpose and useful function, and its template prototype working with any type confirms this impression.

I don’t know about you, but I always had a problem with std::exchange: I couldn’t remember what it was doing. I learnt several times the operations that std::exchange performs, but each time I forgot them soon after.

Then at some point it clicked: std::exchange is a setter returning the old value. Ignoring the name “exchange” but thinking of it as a “setter” helped me make it stick to my mind.

It might just be me having a hard time with std::exchange for some reason. But just in case you also have issues remembering the operations of std::exchange, let’s see why std::exchange has this meaning, and why this meaning is not obvious from its name.

This should help you remember it once and for all...

Concept archetypes — update--Andrzej Krzemieński

Not so easy, but still useful.

Concept archetypes — update

by Andrzej Krzemieński

From the article:

An observant reader indicated that in the previous post where I was trying to implement a concept archetype — a type with minimal interface that models a given concept — I actually failed. This deserves a closer examination...