0

From the 3.2/4:

Every program shall contain exactly one definition of every non-inline function or variable that it odr-used.

I'm interested in example of non-odr-used variable.

Mat
  • 202,337
  • 40
  • 393
  • 406
  • @user657267 I'm interested in the following question: Is it true that every variable is odr-used after her definition? –  May 15 '14 at 07:51
  • Please see the definition (C++11 3.2/3), which is cited in the linked question, for the formal language of "odr-used". The purpose of *not* odr-using something is that you don't *need* a definition, but only a declaration. For example, integral constants are often only needed for their value, not for the object itself, so they're often not odr-used. – Kerrek SB May 15 '14 at 08:18

0 Answers0