CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”
7 人推荐 · 跨 7 个月 · 2020–2026

中文导读
Chandler Carruth 在 CppCon 2019 演讲中直言 C++ 并不存在真正的“零成本抽象”。他结合 unique_ptr、ABI 约束及编译期开销等实操案例,证明任何抽象终归会在运行性能、编译耗时或认知心智上付出代价。
为什么 HN 推它
每当社区争论“零成本抽象”神话时,HN 网友必推此片,尤其常用来解释为何在某些 ABI 规范下 unique_ptr 并非全无开销。
「Chandler 的论点清晰透彻,而且对底层细节挖掘得足够深。」HN 网友原话:Chandler presents his point clearly and goes deep enough into the subject.
英文原摘要(HackerTube / Claude 整理)
Chandler Carruth argues in a CppCon 2019 talk that C++ has no truly zero-cost abstractions. Using examples like unique_ptr, ABI constraints and compile-time costs, he shows that abstractions cost runtime, compile time or human effort.
HN commenters cite it whenever zero-cost abstraction claims come up, especially for why unique_ptr is not free on some ABIs.
HN 上的提及
The talk on ABI-related overhead.
See for a nice expose on this.
Chandler Carruth talks about this at CppCon 2019
I thought there were no zero cost abstractions in C++?
I just wanted to mention this talk about how "zero-cost abstraction" is an idealism, not necessarily a reality