To make this possible, leading whitespace is skipped by default. However, this automatic skipping of whitespace can be turned off (see Section 15.7.7, page 789).
Note that since C++11, concurrent input using the same stream object is possible but might result in characters where it is not defined which thread reads which character (see Section 15.2.2, page 752).