Type Erasure - The Implementation Details - Klaus Iglberger - Meeting C++ 2023

  Рет қаралды 3,528

Meeting Cpp

Meeting Cpp

3 ай бұрын

Type Erasure - The Implementation Details - Klaus Iglberger - Meeting C++ 2023
“If I could go back in time and had the power to change C++, rather than adding virtual function, I would add language support for Type Erasure …” (Eric Niebler, June 19, 2020, Twitter).
For many developers Type Erasure is superior to inheritance with respect to dependency management. And indeed, it has proven itself to be a powerful design pattern, helping to significantly reduce coupling between software entities. Unfortunately, there is no language support for Type Erasure (yet) and many shy away from the seemingly complex implementation details.
In this talk I will give advice on the different ways of how to implement Type Erasure. I’ll start with two very simple, ~20 line implementations for owning and non-owning Type Erasure Wrappers. But I’ll also go into detail about different performance optimization strategies, such as the manual implementation of virtual functions and the Small Buffer Optimization (SBO). After this talk, attendees will know everything to realize and utilize Type Erasure in their own code bases.

Пікірлер: 4
@RudMerriam
@RudMerriam 2 ай бұрын
As alway Klaus provides an interesting approach for C++ development. 😀
@muratsahin1975
@muratsahin1975 Ай бұрын
So, adding new draw or serialize overloads for new ShapeConcepts just really needed? Maybe it should also be included to implementation details of the Shape with a templated version.
@TheOnlyAndreySotnikov
@TheOnlyAndreySotnikov 2 ай бұрын
7:48 Interfaces must always be non-virtual, even if we use good old inheritance-based runtime polymorphism.
Time Travel Debugging - Greg Law - Meeting C++ 2023
1:02:01
Meeting Cpp
Рет қаралды 2,3 М.
小路飞姐姐居然让路飞小路飞都消失了#海贼王  #路飞
00:47
路飞与唐舞桐
Рет қаралды 36 МЛН
ISSEI funny story😂😂😂Strange World | Pink with inoCat
00:36
ISSEI / いっせい
Рет қаралды 26 МЛН
Godzilla Attacks Brawl Stars!!!
00:39
Brawl Stars
Рет қаралды 10 МЛН
Type Erasure
9:42
Everything Cpp
Рет қаралды 10 М.
Внутренности Rabbit R1 и AI Pin
1:00
Кик Обзор
Рет қаралды 2,1 МЛН
Introducing GPT-4o
26:13
OpenAI
Рет қаралды 3,3 МЛН