Articles & Books

Writing a sort comparison function--Raymond Chen

How do you do it?

Writing a sort comparison function part 1, part 2, part 3, part 4

by Raymond Chen

From the article:

I’ve noted in the past that a sort comparison function must follow certain rules, and if you violate those rules, very strange things happen. So what are some patterns for writing sort comparison functions that don’t break the rules?

Most of the time, sorting can be reduced to key comparison: From each element being sorted, you generate a sort key, and those sort keys are compared against each other...

Check Types with Concepts--Rainer Grimm

The series continue.

Check Types with Concepts

by Rainer Grimm

From the article:

Concepts are a powerful and elegant tool to check at compile time if a type fulfills. Thanks to static_assert, you can use concepts as a standalone feature: static_assert(Concept<T>)...

How can I synthesize a C++20 three-way comparison from two-way comparisons?--Raymond Chen

Flying to the future.

How can I synthesize a C++20 three-way comparison from two-way comparisons?

by Raymond Chen

From the article:

The C++20 three-way comparison operator <=> (commonly nicknamed the spaceship operator due to its appearance) compares two items and describes the result. It’s called the three-way comparison because there are five possible results: less, equal, equivalent, greater, and unordered.

Yeah, the name is kind of weird...

Technical Speaking about C++

Meeting C++ organized an event centered around sharing material on creating better talks and presentations for C++:

Technical Speaking about C++

by Jens Weller

About the article:

This event will focus on the process of creating technical talks for the C++ community. Various speakers will share their views on how to submit, prepare and give talks to the C++ community in the form of lightning talks.

 

Should I pay attention to the warning that I’m std::move‘ing from a trivial type? Part 2--Raymond Ch

The series continue.

Should I pay attention to the warning that I’m std::move‘ing from a trivial type? Part 2

by Raymond Chen

From the article:

Last time, we looked at motivations for std::move‘ing from a trivial type. Our investigation looked at the problem through the eyes of the object moved from, but there’s another way to look at the problem, and that’s from the point of view of the object being moved to...

Dawn of a new C++ cycle--Jens Weller

What do you think?

Dawn of a new C++ cycle

by Jens Weller

From the article:

It was 10 years ago when one would realize that a new era for C++ was in its beginning: C++11 was a fundamental change. Many things that one wanted to have in the language or standard library suddenly became available, if one had the right compiler in the newest version. And in this time 10 years ago, the first C++now happend in Aspen, as it has again in the beginning of May...