🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: typedef X;

#2022
From: Jason Merrill
Date: Sun, 24 Sep 1995 06:04
32 lines
1672 bytes
>>>>> Craig P Forbes <craig@mccabe.com> writes:

> My understanding is that the typename keyword may only be used in templates
> to identify subtypes of the template parameters, which otherwise can not be
> identified as a type.

> for example:

> template <T>
> class foo {

>   typename T::i;

This line is semantically null, as the 'typename' keyword only affects the
immediate use of the scope expression, not subsequent uses.

>   int var;

>   void fn() {
>     T::i *var;  //without the typename keyword this could either be a declaration
>                 //or an expression.

This must be 'typename T::i *var;'.

>   }
> };

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 summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <u9n3bvulkx.fsf@phydeaux.cygnus.com>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
References: <MATT.95Sep16194450@Austern> <Etay_Bogner-1709951504510001@metay_pc.stil.scitex.com> <MATT.95Sep20135311@physics2.Berkeley.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage
From: jason@cygnus.com (Jason Merrill)
Newsgroups: comp.std.c++
Subject: Re: typedef X;
Date: 24 Sep 1995 06:04:51 GMT
Organization: Cygnus Support, Mountain View, CA
Sender: jason@cygnus.com
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <u9n3bvulkx.fsf@phydeaux.cygnus.com>
References: <MATT.95Sep16194450@Austern>
 <Etay_Bogner-1709951504510001@metay_pc.stil.scitex.com>
 <MATT.95Sep20135311@physics2.Berkeley.EDU>
NNTP-Posting-Host: taumet.eng.sun.com
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
X-Nntp-Posting-Host: phydeaux.cygnus.com
In-Reply-To: craig@mccabe.com's message of 20 Sep 1995 20:53:11 GMT
X-Newsreader: (ding) Gnus v0.99.28
Content-Length: 640
Originator: clamage@taumet