Articles & Books

Solving the Static Initialization Order Fiasco with C++20--Rainer Grimm

Are you aware of the problem?

Solving the Static Initialization Order Fiasco with C++20

by Rainer Grimm

From the article:

According to the FAQ of isocpp.org is the static initialization order fiasco "a subtle way to crash your program". The FAQ continues: The static initialization order problem is a very subtle and commonly misunderstood aspect of C++. ". Today, I write about this very subtle and misunderstood aspect of C++.

A plea for order -- Philipp Lenk

A few days ago, one particularly ambitious victim student of mine asked for assistance in tracking down a bug.

A plea for order

by Philipp Lenk

From the article:

I know I promised to talk more about emulation, about chess and operating systems, but I have to get something off of my chest first. This is not going to be one of my would-be grand and elongated epics trying to cover far too much in far too many words. Instead, I shall focus on one very small, very self contained thing: the order of #include directives in C++ source code

 

Quick Q; Recursive unordered_map

Quick A: there is no guarantee for a container to work with incomplete types.

Recently on SO:

Recursive unordered_map

STL containers are not required to work with incomplete types. If you don't mind extra indirection, then the workaround is std::map<int, std::unique_ptr<Node>>.

8 years of Meeting C++

8 years ago in 2012, Meeting C++ got started!

8 years of Meeting C++

by Jens Weller

From the article:

In 2012 Meeting C++ got started in July. Planned first to be a one off conference, now it is a successfull international conference and a platform for C++ on the internet.

Designated Initializers--Rainer Grimm

The series continue.

Designated Initializers

by Rainer Grimm

From the article:

Designated initialization is an extension of aggregate initialization and empowers you to directly initialize the members of a class type using their names...

Polymorphic Allocators, std::vector Growth and Hacking

Did you know them?

Polymorphic Allocators, std::vector Growth and Hacking

by Bartlomiej Filipek

From the article:

The concept of a polymorphic allocator from C++17 is an enhancement to standard allocators from the Standard Library.

It’s much easier to use than a regular allocator and allows containers to have the same type while having a different allocator, or even a possibility to change allocators at runtime.

Let’s see how we can use it and hack to see the growth of std::vector containers...