From -5007903380259876264
X-Google-Thread: f78e5,d2ef22ccb120b652
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news2.google.com!proxad.net!news.cs.univ-paris8.fr!news.zanker.org!news.clara.net!wagner.news.clara.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: gdr@cs.tamu.edu (Gabriel Dos Reis)
Newsgroups: comp.std.c++
Subject: Re: A::A::A::A
Date: Wed,  6 Oct 2004 03:48:58 GMT
Organization: Texas A&M University, Department of Computer Science
Lines: 56
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <m3ekkcpvce.fsf@merlin.cs.tamu.edu>
References: <mQb8d.23473$N45.607983@twister2.libero.it> <2wk8d.24685$N45.637605@twister2.libero.it> <m3655pvh1c.fsf@merlin.cs.tamu.edu> <yRE8d.26849$H11.831951@twister1.libero.it>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.demon.co.uk 1097034542 12011 158.152.254.254 (6 Oct 2004 03:49:02 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Wed, 6 Oct 2004 03:49:02 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3
X-Spam-Checker-Version: SpamAssassin 2.64-mulga_r1 (2004-01-11) on 
	mulga.cs.mu.OZ.AU
X-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham 
	version=2.64-mulga_r1
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id i963mwMv002419;
	Wed, 6 Oct 2004 13:48:58 +1000 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-Spam-Level: 
X-Delivered-To: std-c++@ucar.edu
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news1.google.com comp.std.c++:2985

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, if a constructor does not have a name, how can "the name is
instead considered to name the constructor"?  That is a rhetorical
question :-)
  

-- 
                                                        Gabriel Dos Reis
                                                         gdr@cs.tamu.edu
	 Texas A&M University -- Computer Science Department
	301, Bright Building -- College Station, TX 77843-3112

---
[ 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                       ]



