do not click

Meeting C++ 2025   |  Online   |  Training   |  Books   |  Survey   |  Job fair   |  Advertising   |  Jobposting   |  Login

Meeting C++ 2025 - Breaking Dependencies: Type Erasure - The Implementation Details

Conference | Live Schedule | Talks | Get your ticket | Slides | Set your timezone

Breaking Dependencies: Type Erasure - The Implementation Details

Join session

Books by Klaus Iglberger

C++ Software Design: Design Principles and Patterns for High-Quality Software

Klaus Iglberger

On Day 2 at 14:30 (CET/Berlin) in Track C [Jade Room and online]

“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.

Please login to comment

Copyright Meetingcpp GmbH Imprint Privacy Policy