From 872922595860060372
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ede379f5dbbc1549
X-Google-Attributes: gidf78e5,public
From: Hyman Rosen <hymie@prolifics.com>
Subject: Re: Suggestion: "typeof" keyword
Date: 1999/08/24
Message-ID: <t7d7wei370.fsf@calumny.jyacc.com>#1/1
X-Deja-AN: 516723331
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <7nt3vl$1oe$1@nnrp1.deja.com> <7oh7o8$t3f$1@nnrp1.deja.com> <7ol6hi$ej9$2@news.BelWue.DE> <cTiioXAhAwr3Ew$X@robinton.demon.co.uk> <t7d7ww1vrz.fsf@calumny.jyacc.com> <e4DSyfA4ALs3Ew0Q@robinton.demon.co.uk> <t7r9laz5hj.fsf@calumny.jyacc.com> <7oup0a$8g2$1@nnrp1.deja.com> <37B3C2AD.5AB722AE@lucent.com> <37B5A571.449B@wanadoo.fr> <37B908A8.717CAC2C@lucent.com> <CVJFZFAbaWu3Ew15@robinton.demon.co.uk> <7pcvjs$tk4$1@nnrp1.deja.com> <user-1808991258230001@aus-as3-121.io.com> <7phk8n$b26$1@nnrp1.deja.com> <37BD2185.C0047293@physik.tu-muenchen.de> <7pk70i$6as$1@nnrp1.deja.com>
X-Original-Date: 23 Aug 1999 17:42:43 -0400
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 935526587 28252 128.250.29.17 (24 Aug 1999 20:29:47 GMT)
Organization: PANIX Public Access Internet and UNIX, NYC
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN8MAq+EDnX0m9pzZAQGCZgGAi7p6o4vNFM3bGFTlNiPg7ymddW3bfx7I dXdf3/TS+QCfLzi6eOzWl6JGKeCdfkRj =jyVJ
Mime-Version: 1.0
User-Agent: Gnus/5.070084 (Pterodactyl Gnus v0.84) Emacs/20.3
NNTP-Posting-Date: 24 Aug 1999 20:29:47 GMT
Newsgroups: comp.std.c++

niklasb@my-deja.com writes:
> For example, instead of declaring std::find
> with two template parameters, as in
>   template<class II, class T>
>   II find(II begin, II end, const T& val);
> you could make T a function of II, thus:
>   template<class II>
>   II find(II begin, II end, typeof(const typeof(*II())& val));

This is very bad, because it is much too restrictive. In the good version
of find, val merely needs to be equality-comparable to a dereferenced II.
In your version, it must be of the same 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              ]



