4 ms·
People have investigated better solutions than iostreams for decades. But creating a near perfect interface is difficult in C++ because you have almost infinite
by Conscat 3y ago
People have investigated better solutions than iostreams for decades. But creating a near perfect interface is difficult in C++ because you have almost infinite control over the compile time and runtime characteristics of it. It has to compile fast, it has to be extensible (even the formatting syntax is interchangeable and programmable here), it has to give formatting errors at compile time, and it has to run nearly optimally. Victor Zverovich cracked the code, but only after Meta, Boost, and many others put tons of work into their own attempts. Imo, std::format is the most complex part of the standard library so far in terms of its implementation.
Iostream predates parameter packs, which is why they use << for a variadic API.