I was looking at glog's documentation and got confused at the way the stream operator is being used.
LOG(INFO) << "Found " << num_cookies << " cookies";
How can it deduce that all those calls are to form a single log message?
From my understanding, this:
cout << foo << bar << baz;
is equivalent to:
cout << foo;
cout << bar;
cout << baz;
How is it able to group together the chained calls like that without a special delimiter?
EDIT:
I know that you can chain them and why is works, that was not my question. I'm asking how glog can take
LOG(INFO) << "Found " << num_cookies << " cookies";
what looks to me like 3 separate calls to the <<
overload and know that
"Found 3 cookies"
is a single log message as opposed to 3.