🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: possible extension -- typeof(expr)

#3618
From: Jason Merrill
Date: Wed, 06 Mar 1996 21:45
30 lines
1824 bytes
>>>>> Tim Boemker <tjb839@zacatecas.optimum.com> writes:

> Many times in working with STL I've wished for a new operator to return
> the type of an expression, much the same way sizeof returns the size of
> an expression.

> It would allow programs like the following, for example:

>    set<foo, less<foo> > s;
>    for(typeof(s)::iterator i = s.begin(); i != s.end(); i++)
>       // do something

> I suppose this must have been considered by now.  Has anything come of
> it?

It has come up in the committee, but no-one has made a formal proposal, and
it's too late now.

g++ has had typeof for a very long time; I believe some other compilers
(Metaware?) have similar functionality with a different name.

Jason


[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID: <u9ag1t3njg.fsf@yorick.cygnus.com>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
References: <199603061757.AA17403@zacatecas.optimum.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: jason@cygnus.com (Jason Merrill)
Newsgroups: comp.std.c++
Subject: Re: possible extension -- typeof(expr)
Date: 6 Mar 1996 21:45:31 GMT
Organization: Cygnus Support, Mountain View, CA
Sender: jason@cygnus.com
Approved: clamage@eng.sun.com (comp.std.c++)
Message-ID: <u9ag1t3njg.fsf@yorick.cygnus.com>
References: <199603061757.AA17403@zacatecas.optimum.com>
NNTP-Posting-Host: taumet.eng.sun.com
Mime-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
X-Nntp-Posting-Host: yorick.cygnus.com
In-Reply-To: tjb839@zacatecas.optimum.com's message of 6 Mar 1996 18:13:40 GMT
X-Newsreader: Gnus v5.0
X-Lines: 22
Content-Length: 718
Originator: clamage@taumet