R Sahu
R Sahu

Reputation: 206557

What does "object expression" mean in C++

The term "object expression" first appears in the C++11 draft standard in:

3.4.5 Class member access [basic.lookup.classref]

  1. In a class member access expression (5.2.5), if the . or -> token is immediately followed by an identifier followed by a <, the identifier must be looked up to determine whether the < is the beginning of a template argument list (14.2) or a less-than operator. The identifier is first looked up in the class of the object expression. If the identifier is not found, it is then looked up in the context of the entire postfix-expression and shall name a class template.

I could find the definition of "Object Expression" on the web for F# but not for C++.

Is this a commonly understood term? What does it mean?

Upvotes: 3

Views: 543

Answers (1)

If you follow to 5.2.5 [expr.ref], you'll read in paragraph 3:

3 Abbreviating postfix-expression.id-expression as E1.E2, E1 is called the object expression. ...

Previously, paragraph 2 of that section defines E1 -> E2 in terms of (*(E1)).E2, so this quote from paragraph 3 actually covers both . and -> operators.

Upvotes: 10

Related Questions