A step-by-step derivation of the type-erasure idiom, building a minimal std::any from nothing but virtual functions and templates. Deriving Type Erasure by David Álvarez Rosa From the article: Ever looked at std::any and wondered what’s going on behind the scenes? Beneath the intimidating interface is a classic technique called type erasure: concrete types hidden behind a small, uniform wrapper.