4 ms·
With iostream, yeah - but in general C++ templates give the compiler more opportunity to outperform similar generic C code that relies on void pointers/function
by charles-salvia 10y ago
With iostream, yeah - but in general C++ templates give the compiler more opportunity to outperform similar generic C code that relies on void pointers/function pointers. See the classic qsort vs. std::sort archetypal example of this. Also, with printf in particular, modern C compilers will generally parse the format flags at compile time if possible.