3 ms·
I wonder why they wrote the whole thing in header files...
by rwl4 4y ago
I wonder why they wrote the whole thing in header files...
- Matthias247 4y agoHeader-only libraries are a common thing in C++. They allow pretty easy consumption, because the consumer only needs to specify the include path. That's fairly easy with any build system (and C++ has a lot of them). Any binary library would also require building the library itself using the same toolchain and then linking to it - which requires a lot more configuration on the consuming side. It might be easy if both projects use the same build system (e.g. cmake), but that's far from guaranteed in C++.
- ChrisMarshallNY 4y agoI think things have changed, but back when I was doing C++, templates (generics) were implemented in header files, so it was not unusual to have entire programs written in .h files.