Tag Archives: C++17

Moving printf into the modern age using C++17

Ever since c++11 introduce variadic templates, I started seeing people implement some "safe printf" examples. They are pretty cool, but none of them attempted to actually implement the printf fully with all of its quirks. Instead, they all pretty much do the same thing:

  1. Use variadic templates to verify the sanity of the parameters
  2. Delegate the actual formatting to the libc printf

I think we can do better...