Can someone explain this paragraph of an existing standard C ++ 0x draft?

Can someone explain this statement from ISO N3242 §3.2, paragraph 2

A member of the set of candidate functions is used by odr if it is selected to allow overload when mentioning a potentially evaluated expression. [Note. This applies to calls to the named functions (5.2.2), operator overloading (Clause 13), user conversions (12.3.2), a distribution function for placing a new one (5.3.4), and non-default initialization (8.5).

ISO 2003 standard: says

An overloaded function is used if it is selected using overload resolution when a potentially evaluated expression refers to it. [Note: this applies to calls to the named functions (5.2.2), operator overloading (section 13), user-defined conversions (12.3.2), distribution function to place new (5.3.4), and non-default initialization (8.5 )

What is the actual difference in these statements?

Can someone explain this with an example / program?

+4
source share
2 answers

The term “overloaded function” is (slightly) ambiguous between a reference to an element or set. C ++ 11 makes it clear that functions that are never selected from a potentially evaluated expression are not used by odr.

The term "odr-used" is new with C ++ 11. Essentially, this means that the given object can be represented in the final compiled binary and that the rule of one definition is applied.

+7
source

This paragraph has been modified to correct Basic Question No. 1174 . There you can find an example that shows the difference.

+4
source

Source: https://habr.com/ru/post/1347495/


All Articles