Duoas wrote: |
---|
The C counterpart doesn't remember the last modifier you give it either. |
But repeating the format for the C counterpart doesn't involve a full line of text. It's just 4-6 characters tops.
Duaos wrote: |
---|
The only thing that can be said against iostream is that it is more verbose... |
You say that like it's insignificant. For some things I guess it's not a big deal, but for writing trace logs and stuff where you're dumping lots of data, it's quite a big deal.
Galik wrote: |
---|
It might be nice to have a manipulator to configure the stream output according to cstdio formatting rules: |
I've thought about that more than once. The thing is it kind of defeats half the point of using iostream.
cstdio's 2 big problems are:
- type safety
- having to parse a format string
By having a cformat() manipulator you're reintroducing half of the problems iostream solves.
Plus, I don't think there's an iostream equivilent of %g, but I might be wrong on that.
Another idea would be to make modifiers for common output formats. Like:
1 2
|
std::cout << std::c08X << ...
std::cout << std::c04X << ...
| |
But that would require you to write lots of modifiers.