Belloc
Belloc

Reputation: 6390

I have the impression that footnote 32 below applies to the entire paragraph §3.4.1/8 and not only to its third bullet point

[basic.lookup.unqual]/8

For the members of a class X, a name used in a member function body, in a default argument, in an exceptions-pecification, in the brace-or-equal-initializer of a non-static data member (9.2), or in the definition of a class member outside of the definition of X, following the member’s declarator-id 31, shall be declared in one of the following ways:

  1. before its use in the block in which it is used or in an enclosing block (6.3), or
  2. shall be a member of class X or be a member of a base class of X (10.2), or
  3. if X is a nested class of class Y (9.7), shall be a member of Y, or shall be a member of a base class of Y (this lookup applies in turn to Y’s enclosing classes, starting with the innermost enclosing class),32 or
  4. ...

Footnote:

32) This lookup applies whether the member function is defined within the definition of class X or whether the member function is defined in a namespace scope enclosing X’s definition.

Am I right?

Upvotes: 1

Views: 76

Answers (2)

AnT stands with Russia
AnT stands with Russia

Reputation: 320777

I don't see any reason to tie the footnote to bullet point 3. The only thing the footnote says is that member function defined in in-class fashion can "see" the whole class (as would be the case if it was defined in out-of-class fashion). It applies equally to all bullet points.

For example, footnote 32 reaffirms that this code is valid

struct S
{
  void foo() { i = 42; }
  int i;
};

I.e. that the definition of S::foo() can "see" the declaration of S::i even though S::i is declared below the definition of S::foo(). As you can immediately see, the above example has no nested classes and thus has nothing to do with bullet point 3.

Upvotes: 1

Lightness Races in Orbit
Lightness Races in Orbit

Reputation: 385405

The footnote does not mean "this statement is only true for bullet point 3".

It means "by the way, this statement is [also] true for bullet point 3, a slightly more complex scenario with which you may have had your doubts as to the fact so stated".

So, while you're not objectively wrong, this is not any sort of editorial problem either.

Upvotes: 0

Related Questions