Movatterモバイル変換


[0]ホーム

URL:


Issue 90 - WG21 CWG Issues
Title
Should the enclosing class be an "associated class" too?
Status
tc1
Section
6.5.4 [basic.lookup.argdep]
Submitter
John Spicer

Created on1999-02-02.00:00:00 last changed277 months ago

Messages

msg296 (view)
Date: 1999-10-15.00:00:00

Proposed Resolution (10/99):Change the two referenced bullets to read:

  • IfT is a class type (including unions),its associated classes are:the class itself; theclass of which it is a member, if any; and its direct and indirect baseclasses. Its associated namespaces are the namespaces in which itsassociated classes are defined.
  • IfT is an enumeration type,its associated namespace is the namespace inwhich it is defined. If it is class member, its associated class is themember's class; else it has no associated class.
(This proposal also addressesCore issue 91.)
msg88 (view)
Date: 2022-11-20.07:54:16

Section6.5.4 [basic.lookup.argdep] includes the following:

  • If T is a class type, its associated classes are the class itself and itsdirect and indirect base classes. Its associated namespaces are the namespacesin which its associated classes are defined.
  • If T is a union or enumeration type, its associated namespace is the namespacein which it is defined. If it is a class member, its associated class isthe member's class; else it has no associated class.
Note that for a union, the enclosing class is an "associated class", butfor a class type the enclosing class is not an "associated class". Thisresults in some surprising behavior, as shown in the example below.
    struct A {        union U {};        friend void f(U);    };    struct B {        struct S {};        friend void f(S);    };    int main() {        A::U    u;        f(u);        // okay: A is an associated class        B::S    s;        f(s);        // error: no matching f(), B is not an associated class    }
Certainly the enclosing class should also be an associated class for nestedclass types, shouldn't it?

Proposed Resolution (10/99):Change the two referenced bullets to read:

  • IfT is a class type (including unions),its associated classes are:the class itself; theclass of which it is a member, if any; and its direct and indirect baseclasses. Its associated namespaces are the namespaces in which itsassociated classes are defined.
  • IfT is an enumeration type,its associated namespace is the namespace inwhich it is defined. If it is class member, its associated class is themember's class; else it has no associated class.
(This proposal also addressesCore issue 91.)
History
DateUserActionArgs
2003-04-25 00:00:00adminsetstatus: dr -> tc1
2000-02-23 00:00:00adminsetmessages: +msg296
2000-02-23 00:00:00adminsetstatus: review -> dr
1999-02-02 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp