逗号运算符 odr- 使用它的参数吗?

Does the comma operator odr-use its arguments?

根据 odr-use defintion, an object is odr-used if a reference is bound to it. This is why f makes S::x odr-used I believe. What I can not understand is how is that any different from the comma operator 也将其参数绑定到引用参数

struct S {
    static const int x = 0; // static data member
    // a definition outside of class is required if it is odr-used
};
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: a definition is required

内置逗号不会将其操作数绑定到任何东西。

重载逗号可以,但重载运算符只是具有有趣拼写的函数。

这些只是 示例,说明如何在 class 中定义 重载的逗号运算符 。当您绑定到参数时,使用这种重载必然会触发 odr-use。

该用法尚未写入您的程序中,也根本没有运算符重载。

您正在使用 the built-in comma operator

(一个更有趣的问题可能是这个运算符的最右边的操作数是否仍然是 odr-used,因为从 the wording 看来它是这样的!请记住,一个 odr-use violation生成构建错误不需要,在某些情况下也不会。)。

我认为 cppreference 页面在这方面可能有点不清楚。