0:00:03 Introduction: The speaker introduces their interpretation of type erasure, inspired by Klaus, Archer O'Dwyer, and others.
0:00:24 Core Concept: The demonstration involves two independent classes, Cat and Dog, with no shared superclass or interface. Each has unique strategies for getting treats.
Dog uses sit and remembers the number of hairs shed (Strategy 2).
0:01:08 Smart Strategies: Strategies track the number of treats spent to avoid running out.
0:01:20 Goal: Create a vector of stateless, type-erased objects, matching each pet with a strategy (e.g., Rover with Strategy 2, Sleepy with Strategy 2), and call get_treat and get_petted for each.
The StatelessTypeErasure class calls get_treat on the pimple.
The pimple, pointing to a vtable, calls the appropriate Implementation.
The Implementation uses the stored strategy and object.
0:06:31 Question and Answer: Clarifies that StatelessTypeErasure is the single point where independent classes are linked, and it makes copies of the objects and strategies.
0:07:25 Limitation: The original objects (e.g., Rover) don't participate directly in type erasure; their copies do. This prevents querying the original objects' states after they're part of the type-erased vector.