The procedure for evaluating function calls is not specified. Your first expression basically boils down to the following:
cout << a << b << c << d;
Each of the a, b, cand dis a challenge Astack.Pop(). The compiler can generate code that evaluates these calls in any order that it chooses.
, . , ( , ).