Articles & Books

Numbers are not easy -- Šimon Tóth

1*sWhjlJxDvV6icGVeO_cV8A.pngAs the blurb says, "The C++ integral and floating-types zoo"...

Numbers are not easy

by Šimon Tóth

From the article:

Arguably one of the most error-prone parts of C++ is integral and floating-point expressions. As this part of the language is inherited from C, it relies heavily on fairly complex implicit conversion rules and sometimes interacts unintuitively with more static parts of C++ language.

This article will cover the rules and several surprising corner cases one can encounter when working with integral and floating-point types and expressions...

Regular Types -- Rainer Grimm

PortraintRound-1.jpgAs opposed to quirky eccentric ones...

Regular Types

by Rainer Grimm

From the article:

The term concrete type is strongly related to the term regular type. Let me, therefore, start this post with the term concrete type...

C++ Ecosystem in 2022: Fast Adoption of C++17 and C++20... -- Anastasia Kazakova

A new year, a new wave of standards adoption...

C++ Ecosystem in 2022: Fast Adoption of C++17 and C++20, C++ Toolset Landscape, and Better Code Analysis Practices

by Anastasia Kazakova

From the article:

... In this post we’ll discuss the final results, review the trends, and learn which direction the C++ community is currently evolving in. We also invite you to read through the key takeaways and detailed data for many programming languages and areas of software development...

C++ standard: developers are moving fast to C++17 and C++20...

Argument-Dependent Lookup and the Hidden Friend Idiom -- Rainer Grimm

You've got to know where to find them, know how to bind them, know when to ask for help, from a hidden friend...

Argument-Dependent Lookup and the Hidden Friend Idiom

by Rainer Grimm

From the article:

Have you ever wondered why the following program works?

#include <iostream>

int main() {
    std::cout << "Hello world";
}

Why should the program not work? The overloaded output operator operator<< is defined in the std namespace. The question is, therefore: How is the appropriate overloaded output operator for std::string found? You may already assume it...

Making C++ primitive types meaningfully movable when they have sentinel values -- Raymond Chen

A little less primitive...

Making C++ primitive types meaningfully movable when they have sentinel values

by Raymond Chen

From the article:

C++ primitive types do not have special semantics for move constructor or move assignment. Their move operations are just copies. But what if you really want them to move, say, because they have a sentinel value that represents an "empty" state...?

Getting in trouble with mixed construction -- Barry Revzin

How do I construct thee? Let me count the ways...

Getting in trouble with mixed construction

by Barry Revzin

From the article:

Several years ago, I wrote a post about the complexities of implementing comparison operators for optional<T>Getting in trouble with mixed comparisons. That post was all about how, even just for ==, making a few seemingly straightforward decisions leads to an ambiguity that different libraries handle differently.

Now is a good time to circle back to that same idea, except this time instead of talking about equality comparison, we’re just going to talk about construction. This post is going to work through a bunch of cases of trying to construct an object of type X from an object of type Y...