🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3492

template names

#3492
From: Jason Merrill
Date: Fri, 16 Feb 1996 23:10
39 lines
2015 bytes
Does this passage:

  14.2.1  Locally declared names                            [temp.local]

1 Within the scope of a class template or a specialization of a template
  the  name  of  the  template is equivalent to the name of the template
  followed by the template-parameters enclosed  in  <>.   [Example:  the
  constructor  for Set can be referred to as Set() or Set<T>().  ]

make this testcase well-formed?

template <class T> struct A {};
template <class T> struct B
  : public A<B> 		// use of B without parms
{ A* ap; };     		// use of A without parms

How about this?

template <class T> struct A {
  A::A::A* p;
};

What is "the scope of a class template"?  Judging from

  9   Classes                                          [class]

2 A  class-name is inserted into the scope in which it is declared imme-
  diately after the class-name is seen.  The class-name is also inserted
  into  the scope of the class itself.  For purposes of access checking,
  the inserted class name is treated as if it were a public member name.

I would say that A<B> above is ill-formed, and the others are well-formed.
Agree?

Jason
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
Technical Details
Message-ID: <u991i2q34m.fsf@yorick.cygnus.com>
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!chronicle.mti.sgi.com!austern
From: jason@cygnus.com (Jason Merrill)
Newsgroups: comp.std.c++
Subject: template names
Date: 16 Feb 1996 15:10:56 PST
Organization: Cygnus Support, Mountain View, CA
Approved: austern@isolde.mti.sgi.com
Message-ID: <u991i2q34m.fsf@yorick.cygnus.com>
NNTP-Posting-Host: isolde.mti.sgi.com
X-Original-Date: 16 Feb 1996 15:09:29 -0800
X-Newsreader: Gnus v5.0
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBVAwUBMSUPGUy4NqrwXLNJAQGZUQH+IOqJu1fvoYF9wa7xwvSpCTDHaJ9ziOSK
 VeazDUPEmAfdCQC2AODDXWyNzqhpq9MMwWZwExhwmXfOkiqEj7AAag==
 =jcCD
Originator: austern@isolde.mti.sgi.com