Articles & Books

Extended Aggregate Initialisation in C++17--Jonathan Boccara

Were you aware of the change?

Extended Aggregate Initialisation in C++17

by Jonathan Boccara

From the article:

By upgrading a compiler to C++17, a certain piece of code that looked reasonable stopped compiling.

This code doesn’t use any deprecated feature such as std::auto_ptr or std::bind1st that were removed in C++ 17, but it stopped compiling nonetheless.

Understanding this compile error will let us better understand a new feature of C++17: extended aggregate initialisation...

C++20 three way comparison operator — ensure backward compatibility: Part 8--Gajendra Gulgulia

The series continue.

C++20 three way comparison operator — ensure backward compatibility: Part 8

by Gajendra Gulgulia

From the article:

In part one till seven of the tutorial series, we looked at how to use the C++20’s three way comparison operator. In this part of the tutorial series, we’ll look at the compatibility issues when using objects that were constructed before C++20 with the three way comparison operator and how to resolve them...

Why do smart pointers null out the wrapped pointer before destroying it?--Raymond Chen

Ever thought about it?

Why do smart pointers null out the wrapped pointer before destroying it?

by Raymond Chen

From the article:

When you null out a smart pointer type, the smart pointer type nulls out the old pointer before releasing it, rather than releasing the member and then setting it to null. Why does the old value get detached from the smart pointer before releasing it? Why not release it, and then set it to null?

C++20 three way comparison operator: Part 7--Gajendra Gulgulia

The series continue.

C++20 three way comparison operator: Part 7

by Gajendra Gulgulia

From the article:

In the fifth and sixth part of the tutorial series, I explained the comparison category std::strong_ordering and std::weak_ordering respectively with examples and use cases. In this part of the tutorial series, we take a closer look at the third and final comparison category, i.e. std::partial_ordering...

Classic Railroad Field Trip Announced--CppCon 2021

Will you participate?

Classic Railroad Field Trip Announced

From the article:

The CppCon 2021 Field Trip will be an adventure into the mountains to sample classic mountain cuisine from Beau Jo’s, followed by a train trip over the far-famed Georgetown Loop. Spend a fun-filled Sunday on October 24 with fellow attendees as we ascend to 9,101 ft (2,774 m) via air-conditioned buses and railroad coaches. This trip will encompass Geologic, Historic, Natural, and Culinary wonders west of Denver...

Announcing the second set of AMAs for Meeting C++ 2021

Today I can share with you the second set of AMAs at Meeting C++ 2021

Announcing the second set of AMAs for Meeting C++ 2021

by Jens Weller

From the article:

This second set of C++ Experts nicely completes the first one. Its now a mix of folks involved with the C++ Standard complimented with experience in C++ and other languages. All of them have made contributions to C++ and our community, very much looking forward to see the set of questions for each of them in November!

C++20 three way comparison operator--Gajendra Gulgulia

The series continue.

C++20 three way comparison operator part 5 and part 6

by Gajendra Gulgulia

From the article:

In the fourth part of the tutorial, I introduced the theoretical ideas behind the return types of the three way operator in C++20 and demonstrated that there might be semantic restrictions on the program that allow for comparison of equivalence instead of equality. Also I demonstrated by a simple example when can two objects be semantically incomparable, even though the syntax of program allows to compare them and how to deal with such cases with the help of operator<=>...

On the perils of holding a lock across a coroutine suspension point--Raymond Chen

The series continue

On the perils of holding a lock across a coroutine suspension point, part 2: Nonrecursive mutexes

On the perils of holding a lock across a coroutine suspension point, part 3: Solutions

by Raymond Chen

From the article:

Last time, we looked at what can go wrong if you hold a recursive mutex across a coroutine suspension point. Do things get any better if you switch to a nonrecursive mutex?