Closed evandrocoan closed 4 years ago
It might be possible, but it might not be "tiny".
This is a duplicate of issue #19. It's a good idea and I'd implement it if I could. But last time I tried it had some severe consequences in uglifying the syntax required to use format()
— see the last paragraph of https://github.com/c42f/tinyformat/issues/19#issuecomment-58802527 for details.
When some formatting function as
"Hi %s %s.", "Hi"
is used, it will throw a run-time error. If I understand correctly, C++ templates are Turing Complete, so they can do any computation.Then, if they can do any computation, why they cannot count how many times I used the format specifiers
Hi %s %s
in my string, and check if this is equal to the number of parameters"Hi"
passed to the formatting function?