Skip to content

Comment on Type Erasure in C++ Explainedparent

Comments

wouldn't all of this templating lead to immensely increased compile times?

It would presumably take less compile time than a regular vector because the template parts are small shims that call out to the non-template type-erased implementation. A regular vector has to recompile the implementations for each instantiation.

Template heavy C++ (which is a lot of nontrivial C++) DOES have immensely increased compile times hahaha. It's not too bad if you have a decent number of hardware threads and incrementally (re)build in parallel though.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.