I think the insertion/extraction stream operators are strangely appropriate ... maybe it's grown on me.
Originally Posted by GreatEmerald
Here are the advantages:
- No longer need to remember type specifiers
- Can easily overload new << and >> operators for new types
- Can easily cascade them (see below)
As for cascading:
Which is most practical?
Or the equivalent
std::cout << "Today is January ," << 15 << ", " << 2013 << std::endl;
I can't say I advocate operator overloading for most problems, but the ability to cascade them seems to warrant their use for outputting formatted text.
Output(Output(Output(Output(Output(std::cout, "Today is January ,"), 15), ", "), 2013), '\n');