From 8531149424640765207 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,ede379f5dbbc1549 X-Google-Attributes: gidf78e5,public From: postmast.root.admi.gov@iname.com (blargg) Subject: Re: Suggestion: "typeof" keyword Date: 1999/08/19 Message-ID: #1/1 X-Deja-AN: 514829331 X-NNTP-Posting-Host: aus-as5-169.io.com Approved: stephen.clamage@sun.com (comp.std.c++) References: <7nt3vl$1oe$1@nnrp1.deja.com> <7oh7o8$t3f$1@nnrp1.deja.com> <7ol6hi$ej9$2@news.BelWue.DE> <120819991357412479%lisa_lippincott@advisories.com> <37BBDDCA.90D590D4@physik.tu-muenchen.de> X-UID: 0000000001 X-Status: $$$T X-Complaints-To: abuse@io.com X-Trace: hiram.io.com 935088571 13246 208.2.105.169 (19 Aug 1999 18:49:31 GMT) Organization: e-mail address IS valid - but fools the spammers NNTP-Posting-Date: 19 Aug 1999 18:49:31 GMT Newsgroups: comp.std.c++ Originator: clamage@taumet In article <37BBDDCA.90D590D4@physik.tu-muenchen.de>, Christopher Eltschka wrote: > "Siemel B. Naran" wrote: > > > > On 13 Aug 99 15:52:23 GMT, Lisa Lippincott > > > > >/* what type goes here? */ > > >MultiplyAdd( const A& a, const B& b, const C& c ) > > > { return a * b + c; } > > > > In one of my posts I used this > > typeof(A*B+C) MultiplyAdd(...) { ... } > > That's problematic: > > class X {}; > class Y { Y operator*(); }; > X operator*(X, Y); > Y operator*(X*, Y); > > typeof(X**Y) a > > Is a of type X or of type Y? > (That is, is the first star the multiplication operator and the > second one the dereference operator, or is the first one part of > the type, making a pointer to X, and the second one the > multiplication operator?) As I said before (in case anyone missed it), template // heh, I almost typed "typeof" instead of "typename" T make_type(); typeof (make_type() * *make_type()) [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html ]