c++ - Trying to understand [class.qual]/2 in the C++14 Standard -
[class.qual]/2:
in lookup in function names not ignored33 , nested-name-specifier nominates class c:
- if name specified after nested-name-specifier, when looked in c, injected-class-name of c (clause 9), or
- in using-declaration (7.3.3) member-declaration, if name specified after nested-namespecifier same identifier or simple-template-id’s template-name in last component of nested-name-specifier,
the name instead considered name constructor of class c. [ note: example, constructor not acceptable lookup result in elaborated-type-specifier constructor not used in place of injected-class-name. —end note ] such constructor name shall used in declarator-id of declaration names constructor or in using-declaration.
(33) lookups in function names ignored include names appearing in nested-name-specifier, elaborated-type-specifier, or base-specifier.
if consider example below
struct { a(); }; struct b: public { b(); }; a::a() { } is correct that:
- the lookup first
aina::a() {}ignores function names becauseabelongs nested-name-specifier? - the lookup second
aina::a() {}doesn't ignore function names becauseadoesn't belong nested-name-specifier, nor elaborated-type-specifier, nor base-specifier?
Comments
Post a Comment