Deriving Type Erasure / 派生类型擦除

📰 2026-03-15 09:30 更新

🔸 Deriving Type Erasure / 派生类型擦除

🔗 Deriving Type Erasure
🔥 19 points

原文:
March 10, 2026Deriving Type ErasureEver 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.Starting from familiar tools like virtual functions and templates, we’ll build a minimal std::any. By the end, you’ll have a clear

译文:
2026年3月10日派生类型擦除有没有看过std:: any ,想知道幕后发生了什么?在令人生畏的界面下,有一种叫做类型擦除的经典技术:隐藏在一个小而统一的包装后面的具体类型。从熟悉的工具(如虚拟函数和模板)开始,我们将构建一个最小的std:: any。到最后,您将清楚地了解


自动更新 · 正文抓取 · 双语翻译

Leave a Comment