3 ms·
> C++ templates are not exactly known for their blazingly fast compilation speed. Compared to what alternative that does the same thing, in C++? Modern C++ co
by kazinator 2y ago
> C++ templates are not exactly known for their blazingly fast compilation speed.
Compared to what alternative that does the same thing, in C++?
Modern C++ compilers, as such, are slow as molasses, on multi-GHz hardware with huge L1 and L2 caches, whether your code uses templates or not.
- Joker_vD 2y agoThe alternative would be to run the JSON through e.g. jq/sed and make it dump out a chunk of C++ that would create an object with proper fields and subobjects. This C++ code will have about zero template chicanery; instead, it would just call constexpr constructors which, I imagine, would be entirely boring — this C++ code will be compiled much faster.