[basic.def.odr]/2中的示例以下面的句子开头:
在下面的示例中,n的初始值设定项的潜在结果集包含第一个S :: x子表达式,但不包含第二个S :: x子表达式.
从本段的定义中,我们如何推断出n的初始值包含第一个S :: x子表达式,而不是第二个S :: x子表达式?
编辑 请参阅下面上面提到的示例的其余部分:
struct S { static const int x = 0; };
const int &f(const int &r);
int n = b ? (1, S::x) // S::x is not odr-used here
: f(S::x); // S::x is odr-used here, so
// a definition is required
Run Code Online (Sandbox Code Playgroud)