How does an instruction like cout « "time is
" « theTimeStamp « endl; work?
Can parenthesize is as (((cout « "time is
") « theTimeStamp) « endl); to make it clearer
Each « operator is a binary operator whose left
operand is an object of type ostream (like the cout
object); we need to define an operator overloading for each new
type that the right operand can take
Luckily, many overloadings are already defined in the
Standard Template Library
Note: in order for the chain of « operators to output
all their data to the same ostream object, each operator
must return the same object given at the beginning of the
chain (in this case, cout)
In other words, each overloading must end with the statement
return outStream; (notice outStream is the very
same name of the input parameter -- so if the input
parameter was, say, cout, then that's what's being
returned by the overloading)