C++ Compile time conditional struct member variables--Saleem Ahmad

Before we get metaclasses one day?

C++ Compile time conditional struct member variables

by Saleem Ahmad

From the article:

C++ has rich set of features to do compile time calculations and optimizations to generate a better code. In one of code segment I have very large data structure in which few member variables are not used based on compile time if constexpr condition, but these variables are logged in the log line...

std::exchange Patterns: Fast, Safe, Expressive, and Probably Underused--Ben Deane

Do you know about it?

std::exchange Patterns: Fast, Safe, Expressive, and Probably Underused

by Ben Deane

From the article:

This blog post has been a long time in the making. I gave a lightning talk on std::exchange at CppCon 2017; Jonathan first asked me to write something about std::exchange in January 2019; now here we are in the strange days of the second half of 2020. But although much has changed in the outside world, I would guess that not much has changed in most C++ codebases and in the minds of many C++ programmers with respect to using std::exchange. It could still do with more publicity and more recognition of potential use cases...

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...

Refactoring from single to multi purpose

Working on an old project, it came to my mind that I do this refactoring from one static path to multiple options for the 2nd time this year...

Refactoring from single to multi purpose

by Jens Weller

From the article:

For the second time this year I'm refactoring a program from a single purpose to have two or more modes of operation. Both times the start and end result is similar, just the processing is different. A classic case of using polymorphism.

The first program was a tool to process videos from speakers, find a face and export the subframe around it into a new video. The first mode was a good approach to test it, and gave results for some speakers. The second mode did a complete scan first, and then gave a smoother video for some videos. Still, both modes had to be retained...

Announcing Meeting C++ Trainings!

Meeting C++ Trainings - a site for online trainings launched on Monday:

Announcing the start of Meeting C++ Trainings

by Jens Weller

From the article:

Meeting C++ organizes now its own online trainings, learn C++ from the leading experts!

You can choose trainings from several trainers and participate in the training you need online. Both half day and full day trainings are available. Right now the listed trainings start by mid June and go into July, but soon also Trainings in August and September will be available. My goal is to offer 1-2 Trainings per trainer in one quarter...