From -3438782051499915095 X-Google-Thread: f78e5,d2ef22ccb120b652 X-Google-Attributes: gidf78e5,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!transit.nntp.hccnet.nl!border2.nntp.ams.giganews.com!nntp.giganews.com!news-hub.cableinet.net!blueyonder!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull From: AlbertoBarbati@libero.it (Alberto Barbati) Newsgroups: comp.std.c++ Subject: Re: A::A::A::A Date: Wed, 6 Oct 2004 17:23:23 GMT Organization: [Infostrada] Lines: 58 Sender: mail2news@demon.net Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++) Message-ID: References: <2wk8d.24685$N45.637605@twister2.libero.it> NNTP-Posting-Host: news.news.demon.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.demon.co.uk 1097083410 262 158.152.254.254 (6 Oct 2004 17:23:30 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Wed, 6 Oct 2004 17:23:30 +0000 (UTC) X-Received-SPF: none (mailbox3.ucsd.edu: domain of news@twister2.libero.it does not designate permitted sender hosts) X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Virus-Scanned: by amavisd-new at libero.it serv5 X-Path: comp-std-cpp-robomod!not-for-mail X-Received: (from fjh@localhost) by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i96HNNDE013779; Thu, 7 Oct 2004 03:23:23 +1000 (EST) X-NNTP-Posting-Date: Wed, 06 Oct 2004 10:21:12 MET DST X-Delivered-To: std-c++@ucar.edu X-Spamscanner: mailbox3.ucsd.edu (v1.5 Aug 25 2004 09:28:35, 0.0/5.0 3.0.0-rc1) X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on mulga.cs.mu.OZ.AU X-Accept-Language: en, it X-Spam-Status: No, hits=-4.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.64-mulga_r1 X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-Newsgroups: comp.std.c++ X-MailScanner: PASSED (v1.2.8 27661 i968LEI0034714 mailbox3.ucsd.edu) Xref: g2news1.google.com comp.std.c++:2992 Gabriel Dos Reis wrote: > AlbertoBarbati@libero.it (Alberto Barbati) writes: > > [...] > > | > | the name A is injected in the scope of A, it's not a member of A, so > | > | writing A::A is illegal. > | > That is wrong. > | > A::A is valid. It designates the constructor. > | > | Notice that it doesn't even refer to the > | > | class constructor, because constructors have no name. > | > That is not true. The standard specifically says that it designates > | > the constructor. > | > > | > | Of course I may have been mistaken, but I couldn't find where the > | standard says that. Could you enlighten me, please? > > 3.4.3.1/1a > > 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 9), 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 a constructor > definition that appears outside of the class definition. [Example: > > struct A { A(); }; > struct B: public A { B(); }; > > A::A() { } > B::B() { } > > B::A ba; // object of type A > A::A a; // error A::A is a not a type name > > --end example] > So what I said wasn't completely wrong as you stated. I wrote "writing A::A is illegal" and *in that context* (which wasn't "in the declarator-id of a constructor definition that appears outside of the class definition") it was in fact illegal. ;-) > So, if a constructor does not have a name, how can "the name is > instead considered to name the constructor"? That is a rhetorical > question :-) :-D Alberto --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]