Created on 2000-11-13.00:00:00 last changed 197 months ago
[Voted into WP at April 2003 meeting.]
Proposed Resolution (revised October 2002):
Change paragraph 1a in 6.5.5.2 [class.qual] (added by the resolution of issue 147) as follows:
If the nested-name-specifier nominates a class C, and the name specified after the nested-name-specifier, when looked up in C, is the injected-class-name of C ( Clause 11 [class]), the name is instead considered to name the constructor of class C. Such a constructor name shall be used only in the declarator-id of aconstructor definitiondeclaration thatappears outside of the class definitionnames a constructor....
Note: the above does not allow qualified names to be used for in-class declarations; see 9.3.4 [dcl.meaning] paragraph 1. Also note that issue 318 updates the same paragraph.
Change the example in 11.8.4 [class.friend], paragraph 4 as follows:
class Y { friend char* X::foo(int); friend X::X(char); // constructors can be friends friend X::~X(); // destructors can be friends //... };
Notes from 04/01 meeting:
The consensus of the core language working group was that it should be permitted to declare constructors as friends.
According to 11.4.5 [class.ctor] paragraph 1, a declaration of a constructor has a special limited syntax, in which only function-specifiers are allowed. A friend specifier is not a function-specifier, so one interpretation is that a constructor cannot be declared in a friend declaration.
(It should also be noted, however, that neither friend nor function-specifier is part of the declarator syntax, so it's not clear that anything conclusive can be derived from the wording of 11.4.5 [class.ctor].)
History | |||
---|---|---|---|
Date | User | Action | Args |
2008-10-05 00:00:00 | admin | set | status: wp -> cd1 |
2003-04-25 00:00:00 | admin | set | messages: + msg867 |
2003-04-25 00:00:00 | admin | set | status: ready -> wp |
2002-11-08 00:00:00 | admin | set | status: review -> ready |
2002-05-10 00:00:00 | admin | set | messages: + msg626 |
2002-05-10 00:00:00 | admin | set | status: drafting -> review |
2001-05-20 00:00:00 | admin | set | messages: + msg495 |
2001-05-20 00:00:00 | admin | set | status: open -> drafting |
2000-11-13 00:00:00 | admin | create |