3 ms·
Adding Compile-Time Type Checking to Printf
- SloopJon 12y ago> The only reason printf needed to embed that extra type information was because the C programming language lacked variadic templates. And to specify the format. If you want this function to print your integer as hexadecimal, for example, I guess you have to format it first.
- gpvos 12y agoHardcode it in the compiler already. GCC has had it since 1992, Norcroft C even earlier if I remember correctly.
- MaulingMonkey 12y agoI use boost::format when I want a type safe printf-like in C++.