🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Jason Merrill Fri, 16 Feb 1996 23:10
template names
#3492
Author: 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. ]
Re: template names
#3493
Author: David Vandevoorde
Date: Sun, 18 Feb 1996 02:14
18 lines
1308 bytes
>>>>> "JM" == Jason Merrill <jason@cygnus.com> writes:
[...]
JM> I would say that A<B> above is ill-formed, and the others are
JM> well-formed.  Agree?

Yes, it seems right. I take it that the ``scope of the class template''
is (can be) defined in terms of template classes it can generate and
that 3.3.6 [basic.scope.class] applies...

	Daveed


[ To submit articles: Try just posting with your newsreader.  If that fails,
		      use mailto:std-c++@ncar.ucar.edu
  FAQ:    http://reality.sgi.com/employees/austern_mti/std-c++/faq.html
  Policy: http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads