From Jason Turner
Watch on YouTube

Summary

This episode explores different approaches to type erasure in C++, showcasing techniques to hide exact types at runtime. Jason demonstrates three main methods: traditional inheritance-based polymorphism, std::function as a canonical example of complex type erasure, and a lightweight 'view' approach using function pointers and lambdas that avoids dynamic allocation while still providing interface abstraction.

Resources

Tags