Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我定义一些这样的变量时:
int a = pop(), b = pop(), c = pop();
C++ 是否保证a先初始化,然后b再初始化c?还是没有定义顺序?
a
b
c
[dcl.decl]/3 说
-3- 声明中的每个 init-declarator 都被单独分析,就好像它本身在声明中一样。
这意味着您的代码被视为:
int a = pop(); int b = pop(); int c = pop();