C++ Programming/Operators/Chaining

Chaining
The above line illustrates what is called chaining of insertion operators to print multiple expressions. How this works is as follows:
 * 1) The leftmost insertion operator takes as its operands, std::cout and the string "The sum of ", it prints the latter using the former, and returns a reference to the former.
 * 2) Now std::cout << a is evaluated. This prints the value contained in the location a, i.e. 123 and again returns std::cout.
 * 3) This process continues. Thus, successively the expressions std::cout << " and ", std::cout << b, std::cout << " is ", <tt>std::cout << " sum "</tt>, <tt>std::cout << "\n"</tt> are evaluated and the whole series of chained values is printed.