Namespaces
Variants
Actions

Talk:cpp/language/definition

From cppreference.com
int n = b ? (1, S::x) // S::x is not odr-used here

It is unclear why? Is b false? Or should 1 have followed S::x in the comma expression? --0xF (talk) 11:56, 8 March 2021 (PST)

"ODR-use" essentially just means the object's address is required for an expression, that's not the case here (where S::x is a constant expression), we just need the value. --Ybab321 (talk) 02:17, 5 March 2021 (PST)
I see, thanks! --0xF (talk) 11:56, 8 March 2021 (PST)