The Self-Growing Builder--Marco Arena
Some sugar added to a classical pattern:
The Self-Growing Builder
by Marco Arena
From the article:
we had a quick digression on “C++ named parameters”...
June 16-21, Sofia, Bulgaria
September 13-19, Aurora, CO, USA
October 25, Pavia, Italy
November 6-8, Berlin, Germany
November 16-21, Kona, HI, USA
By Marco Arena | Oct 25, 2021 03:05 AM | Tags: intermediate
Some sugar added to a classical pattern:
The Self-Growing Builder
by Marco Arena
From the article:
we had a quick digression on “C++ named parameters”...
By Adrien Hamelin | Oct 21, 2021 11:58 AM | Tags: intermediate
Do you know about them?
Design Patterns VS Design Principles: Observer, State and Strategy
by Jonathan Boccara
From the article:
In this series of articles on design patterns and design principles, we analyse how the 23 GoF design patterns relate to the 9 GRASP design principles.
In a previous article, we classified the GRASP patterns like this (excluding “Managing complexity”).
The study we perform in this series is helpful to understand better both the GoF and the GRASP, with the goal of taking better decisions when it comes to organizing our code.
The GoF design patterns come from the seminal Design Patterns book. The GRASP design principles are explained in Craig Larman’s Applying UML and Patterns.
In this episode of the series, we examine the Observer, State and Strategy design patterns...
By Adrien Hamelin | Oct 20, 2021 11:31 AM | Tags: intermediate
Do you have that problem?
6 Ways to Refactor new/delete into unique ptr
by Bartlomiej Filipek
From the article:
In legacy code, you can often spot explicit new and delete lurking in various places and waiting to produce pointer-related issues. This blog post shows six patterns to improve that erroneous style and rely on modern techniques, especially unique_ptr and other helper standard types...
By Adrien Hamelin | Oct 20, 2021 11:29 AM | Tags: basics
The series continue.
Automatic Return Type (C++98)
by Rainer Grimm
From the article:
Depending on the used C++ standard, there are different ways to return the right return type of a function template. In this post, I start with traits (C++98), continue in my next post with C++11/14, and end with concepts (C++20)...
By Adrien Hamelin | Oct 15, 2021 01:54 PM | Tags: intermediate
Simple and surprising.
A simple and clear example of undefined behavior
by Jens Weller
From the article:
If you work with C++ you'll sooner or later will have to deal with undefined behavior. I stumbled upon an easy example to help folks understand the scope of undefined behavoir...
By Blog Staff | Oct 15, 2021 10:07 AM | Tags: None
Thanks to the Chinese C++ experts who did this translation of Bjarne Stroustrup's latest History of Programming Languages paper! That's a massive job, and translations of technical papers are very rare in our field.
Bjarne Stroustrup: Thriving in a crowded and changing world: C++ 2006-2020
See also: Pre-recording and Q&A
ACM/SIGPLAN History of Programming Languages conference, HOPL-IV. London. June 2020.
All the HOPL-4 papers are posted as Proceedings of the ACM on Programming Languages Vol. 4.
By Adrien Hamelin | Oct 11, 2021 12:50 PM | Tags: intermediate
The series continue.
Dependent Names
by Rainer Grimm
From the articles:
A dependent name is essentially a name that depends on a template parameter. A dependent name can be a type, a non-type, or a template parameter. To express that a dependent name stands for a type or a template, you have to use the keywords typename or template...
By Adrien Hamelin | Oct 8, 2021 01:03 PM | Tags: community
New capabilities.
Compiler Explorer with Cmake
by Gajendra Gulgulia
From the article:
Compiler explorer has been one of the most widely used online tool for compiling C++ code, doing experiment with C++ features, sharing code snippets with friends and colleagues and also (my favorite feature) to compare and prove with the help of assembly code why a certain way of coding might be good or bad compared to another way.
Recently compiler explorer added support for compiling multiple files with CMakeLists.txt [1] . This opens up a new possibilities for developers around the world from testing complex pieces of code to testing the compilation behavior of the same.
In this issue, I would like to give a walk through on how to set up a simple layout of three files compiled with CMakelists.txt. Note that the focus is on setting up compiler explorer for multiple files and not on code efficiency. Also the article might at first glance look lengthy, but it may only be due to 19 images in the tutorial. So don’t get weighed down by the size of the article and lets start!
By Adrien Hamelin | Oct 8, 2021 12:58 PM | Tags: c++11
Are you using them?
A Recap on User Defined Literals
by Jonathan Boccara
From the article:
User defined literals were introduced in C++11, evolved in C++14 and C++17, and are a nice way to write more expressive code.
The general idea behind user defined literals is that they allow to write a value and tack on a term describing what this value represents. For example:
auto const quantity = 42_bottles_of_water;In this expression, 42 is the value and _bottles_of_water is the user defined suffix. The expression as a whole is a user defined literal.
A common usage of user defined literals is to represent units, but they can also be used to add meaning to values in more general contexts.
Here is how to write user defined literals in C++11, C++14 and C++17...
By Jens Maurer | Sep 30, 2021 11:56 AM | Tags: None
First steps using modern C++
Improving Stability with Modern C++, Part 1 — Getting Started
by Ralph Kootker, FactSet
From the article:
While the C++11 standard recently had its 10th birthday, there are still developers out there using modern C++ for the first time. With that in mind, we’ve prepared a series of short introductory posts on the features of C++11 and beyond.