3 ms·
Context: Spent most of my C-ish experience on Objective-C What is the advantage of header-only? My mental model was headers ~= implementation as far as compil
by refulgentis 3y ago
Context: Spent most of my C-ish experience on Objective-C
What is the advantage of header-only?
My mental model was headers ~= implementation as far as compiler is concerned, thus limiting the size of headers is a way to indicate API surface area and document.
- linkdd 3y agoThe "header-only" is actually accidental. It's all C++ template classes, which must be fully defined at their declaration site (so the header). When using the template, the compiler will generate the code needed by "instantiating the template" (for lack of a better word). The other advantage is that it requires no build system to include in your project.