3 ms·
I recently came across a C++ logging library that parses format strings at compile time using template necromancy: https://blapid.github.io/cpp/2017/10/31/llcp
by twic 8y ago
I recently came across a C++ logging library that parses format strings at compile time using template necromancy:
https://blapid.github.io/cpp/2017/10/31/llcpp-a-quest-for-faster-logging-part-2.html https://blapid.github.io/cpp/2017/10/31/llcpp-a-quest-for-fa...
- DerDangDerDang 8y agoThe cool kids are doing it with constexpr. See spdlog and/or fmt
- twic 8y agofmt can check format strings at compile time, but does it generate code to do the formatting? Some quick experiments suggests it will re-parse the format string at runtime to do the formatting.
- dangets 8y agoF# has statically type checked printf also. I know it's a completely different realm than C++, but still pretty interesting. https://fsharpforfunandprofit.com/posts/printf/ https://fsharpforfunandprofit.com/posts/printf/