shared_ptr - basics and internals with examples--Hitesh Kumar

Did you know it?

shared_ptr - basics and internals with examples

by Hitesh Kumar

From the article:

The C++11 std::shared_ptr<T> is a shared ownership smart pointer type. Several shared_ptr instances can share the management of an object's lifetime through a common control block. The managed object is deleted when the last owning shared_ptr is destroyed (or is made to point to another object). Memory management by shared_ptr is deterministic because the timing of a managed object's destruction is predictable and in the developer's control. Hence, std::shared_ptr brings deterministic automatic memory management to C++, without the overhead of garbage collection. Here is a basic example of shared_ptr...

corobatch: using coroutines to batch operations with no effort--Francesco Zoffoli

Interested?

corobatch: using coroutines to batch operations with no effort

by Francesco Zoffoli

From the article:

Often performing operations in batch is more efficient than doing them one at a time. Typical examples could be most kinds of I/O, or vectorized instructions.

Unfortunately, doing operations on groups of items at the same time can be much less readable than doing them one element at a time...

Runtime Polymorphism with std::variant and std::visit--Bartlomiej Filipek

Different compromise.

Runtime Polymorphism with std::variant and std::visit

by Bartlomiej Filipek

From the article:

Runtime polymorphism usually connects with v-tables and virtual functions. However, in this blog post, I’ll show you a modern C++ technique that leverages std::variant and std::visit. This C++17 technique might not only offer better performance and value semantics, but also interesting design patterns...

Fundamental operations on type lists (Part2) -- Szilard Szaloki

Part2 of Fundamental operations on type lists is now available, featuring common template metaprogramming idioms, like multiple inheritance and the void* trick, demonstrated on simple metafunctions, such as push_front<>, push_back<>, pop_front<> and pop_back<>.

Fundamental operations on type lists (Part2)

by Szilard Szaloki

From the article:

Among the simplest metafunctions are push_front<> and push_back<>, since they can be easily implemented by leveraging C++11's parameter pack expansion...

Fundamental operations on type lists (Part1) -- Szilard Szaloki

Check out this article on basic C++ template metaprogramming concepts, such as type lists and metafunctions. This post also elaborates on alias templates and their limitations,
presents different approaches to implementing four fundamental metafunctions (first<>, front<>, last<> and back<>) and introduces a common metaprogramming primitive: apply<>.

Fundamental operations on type lists (Part1)

by Szilard Szaloki

From the article:

One of the fundamental building blocks of template metaprogramming is type lists. Dealing with them used to be a hassle, but since C++11 they are pretty much built into the language through type template parameter packs...

Italian C++ Conference 2020 will be an online-only event--Marco Arena

Due to COVID-19 global situation, we have made the decision that:

Italian C++ Conference 2020 will be an online-only event

by Marco Arena

From the article:

In light of recent developments globally and the growing concerns around the spread of the COVID-19 virus, we have made the decision that this year’s Italian C++ Conference will be an online-only/virtual event. It will be scheduled for the same day at the same time (June 13 from 9 AM to 6 PM CEST)...

C++20: More Details to Coroutines--Rainer Grimm

Understand them to be able to use them.

C++20: More Details to Coroutines

by Rainer Grimm

From the article:

My job in this and further posts is to explain the framework for building coroutines. On the end, you can create your own or using an existing implementation of coroutines such as the excellent one cppcoro from Lewis Baker.

Today's post is in-between: This post is not an overview but also not in-depth dive into the coroutines framework that follows in the next posts.

The first question you may have is: When should I use coroutines?