When I'm defining some variables like this:
int a = pop(), b = pop(), c = pop();
does C++ give a guarantee that a
is going to be initialized first, then b
and then c
? or is the order not defined?
When I'm defining some variables like this:
int a = pop(), b = pop(), c = pop();
does C++ give a guarantee that a
is going to be initialized first, then b
and then c
? or is the order not defined?
[dcl.decl]/3 says
-3- Each init-declarator in a declaration is analyzed separately as if it was in a declaration by itself.
Which means your code is treated like:
int a = pop();
int b = pop();
int c = pop();