🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Peter Teuben Wed, 16 Dec 1992 21:23
Template names
#1265
Author: Peter Teuben
Date: Wed, 16 Dec 1992 21:23
22 lines
959 bytes
If one defines a template as e.g.

  template <class T> class star {
	...
  };

and also define a real class with that same 'template' name, i.e.

  class star {
        ...
  };

the Borland C++ compiler (3.0) complains. Can anybody confirm if this 
is a Borland bug?

	Peter
--
Peter J. Teuben         |  INTERNET  : teuben@astro.umd.edu
Astronomy Department    |  FAX:        (301) 314-9067
University of Maryland  |  MA-BELL   : (301) 405-1540 (office)
College Park, MD 20742  |              (301) 405-1502 (secr.)
Re: Template names
#1283
Author: Pete Becker
Date: Thu, 17 Dec 1992 17:25
24 lines
1109 bytes
In article <TEUBEN.92Dec16162305@lynx.astro.umd.edu> teuben@lynx.astro.umd.edu (Peter Teuben) writes:
>
>If one defines a template as e.g.
>
>  template <class T> class star {
>	...
>  };
>
>and also define a real class with that same 'template' name, i.e.
>
>  class star {
>        ...
>  };
>
>the Borland C++ compiler (3.0) complains. Can anybody confirm if this 
>is a Borland bug?

	I hope not, since it isn't a bug.  ARM, section 14.2:

	A class template name must be unique in a program and may not
	be declared to refer to any other template, class, function,
	object, value, or type in the same scope.

	-- Pete
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