Cheat Sheets & Infographics--André Müller
Compact.
Cheat Sheets & Infographics
by André Müller
From the article:
February 10-15, Hagenberg, Austria
March 19-21, Madrid, Spain
April 1-4, Bristol, UK
June 16-21, Sofia, Bulgaria
By Adrien Hamelin | Feb 25, 2022 12:07 PM | Tags: community
Compact.
Cheat Sheets & Infographics
by André Müller
From the article:
By Adrien Hamelin | Feb 25, 2022 12:05 PM | Tags: intermediate c++20
You don't know them yet?
The 114 standard C++ algorithms. Introduction
by Šimon Tóth
From the article:
Welcome to a new series on C++ standard algorithms. Standard algorithms offer safe and optimized building blocks that can replace a surprising amount of user code...
By Adrien Hamelin | Feb 24, 2022 12:03 PM | Tags: c++20
Modules are coming.
How to Use C++20 Modules with Bazel and Clang
by Ryan Burn
From the article:
Modules are a feature added to C++20 that aims to provide better encapsulation and faster build times. While modules are not fully supported by compilers and probably not ready for use in production code, Clang’s support is fairly usable.
In this guide, I’ll show you how to use modules with Clang and the Bazel build system by making use of the project github.com/rnburn/rules_cc_module.
Let’s look at it works on a simple hello world program...
By Adrien Hamelin | Feb 24, 2022 12:01 PM | Tags: c++17
Have you ever used it?
constexpr if
by Rainer Grimm
From the article:
In today's post, I want to introduce a very interesting C++17 feature: constexpr if. constexpr if enables it to conditionally compile source code and can also be used for nice tricks at compile time...
By Adrien Hamelin | Feb 24, 2022 11:46 AM | Tags: c++20
Making things clearer.
Projections are Function Adaptors
by Barry Revzin
From the article:
There was a question recently on StackOverflow where a user was confused about the purpose of projections in a way that I think is fairly common...
By Adrien Hamelin | Feb 23, 2022 02:53 PM | Tags: None
What are your thoughts?
Design Patterns VS Design Principles: Visitor
by Jonathan Boccara
From the article:
In today’s episode of the series “Design Pattens VS Design Principles”, we’re focusing on the last behavioural design pattern: Visitor, and see how it relates to the High Cohesion design principle...
By Vittorio Romeo | Feb 18, 2022 12:22 PM | Tags: None
This article features an interview to the four authors of the newly released "Embracing Modern C++ Safely" book, motivating the surprising decision to analyze C++11 and C++14 in-depth in 2021, and discussing the contents and style of the publication.
Why 4 Bloomberg engineers wrote another C++ book
Tech At Bloomberg
From the article:
But why do we need yet another C++ book? After all, one of the book’s principal authors, John Lakos, has already written two. And why now? Why Bloomberg? Who is this for? But first, why modern C++? [...] The authors limited the book to features with which they have accumulated more than five years of experience. The current edition is an authoritative summary of C++11 and C++14 features, and future editions are planned to cover C++17 and C++20.
(Note that "Embracing Modern C++ Safely" is on sale (up to 55% off) until February 26.)
By Adrien Hamelin | Feb 16, 2022 09:56 AM | Tags: c++20
Many new possibilities.
constexpr and consteval Functions in C++20
by Rainer Grimm
From the article:
With C++20, constexpr became way more powerful. Additionally, we have consteval functions in C++20 that are quite similar to constexpr functions...
By Adrien Hamelin | Feb 16, 2022 09:50 AM | Tags: advanced
How did you solve it?
On finding the average of two unsigned integers without overflow
by Raymond Chen
From the article:
Finding the average of two unsigned integers, rounding toward zero, sounds easy:
unsigned average(unsigned a, unsigned b) { return (a + b) / 2; }However, this gives the wrong answer in the face of integer overflow: For example, if unsigned integers are 32 bits wide, then it says that average(0x80000000U, 0x80000000U) is zero...
By Adrien Hamelin | Feb 16, 2022 09:41 AM | Tags: c++17
Have you ever done that?
Technique: Compile Time Code Generation and Optimization
by Jonathan Müller
From the article:
C++ constexpr is really powerful. In this blog post, we’ll write a compiler that can parse a Brainfuck program given as string literal, and generate optimized assembly instructions that can then be executed at runtime. The best part: we neither have to actually generate assembly nor optimize anything ourselves! Instead we trick the compiler into doing all the hard work for us.
The same technique can be used whenever you want to specify some sort of “program” in a different way and translate it at runtime: regexes, routing tables, etc.