by PythonicAlpha · 12y ago · 0 comments
It would be interesting, how the situation is in C++ with its newer stream based output, that is more based on compiler support (as much I know). Does anybody have experiences with it?
My understanding is that the main motivation behind the introduction of iostream was to make a type-safe variant of printf. So with iostreams the _type_ of the value is determined at compile-time, but the representation (e.g. should it be stringified as dec or hex? should it be left-align or right?) needs to be determined at run-time.
In other words, the design issue is only partially solved with iostreams in terms of performance.