C++ Type Erasure

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Introduction

Type erasure is a set of techniques for creating a type that can provide a uniform interface to various underlying types, while hiding the underlying type information from the client. std::function<R(A...)>, which has the ability to hold callable objects of various types, is perhaps the best known example of type erasure in C++.



Got any C++ Question?