From 5260392290171672006
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 109fba,109af18a94b8a35c
X-Google-Attributes: gid109fba,public
X-Google-Thread: f78e5,e5cae9ffbf1dd57e
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1992-10-04 18:05:24 PST
Xref: sparky comp.lang.c++:14514 comp.std.c++:1301
Path: sparky!uunet!haven.umd.edu!darwin.sura.net!sgiblab!cs.uoregon.edu!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!sm86+
From: osoelgaultier+@CMU.EDU (Stefan Monnier)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: The concept of templates considered ill designed
Message-ID: <0enxJ1W00awTMNepU8@andrew.cmu.edu>
Date: 4 Oct 92 21:40:17 GMT
Article-I.D.: andrew.0enxJ1W00awTMNepU8
References: <RAYMOND.92Sep29122502@cobra.es.ele.tue.nl> <1992Oct1.140643.9775@cadsun.corp.mot.com> <1992Oct2.153826.12051@ucc.su.OZ.AU> <BvM0DE.EA7@watcgl.uwaterloo.ca> <23796@alice.att.com> <Ienr=wm00awU8A=Ecc@andrew.cmu.edu>
	<23801@alice.att.com>
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
Lines: 37
In-Reply-To: <23801@alice.att.com>

Excerpts from netnews.comp.lang.c++: 5-Oct-92 Re: The concept of
template.. Andrew Koenig@alice.att. (287)

> In article <Ienr=wm00awU8A=Ecc@andrew.cmu.edu> osoelgaultier+@CMU.EDU
> (Stefan Monnier) writes:

> > But the suggested 'templates with type constraint' would
> > permit to change it into an implementation issue.

> Really?  Why do you think so?
> -- 
> 				--Andrew Koenig
> 				  ark@europa.att.com


As are currently implemented templates, you don't know
anything about the actual type at compile-time.
So that no method calls or variable accesses can be compiled
for any variable of 'template type'.

The only thing you can do at compile-time with those variables
is to store them and retrieve them in a structure, but, again, 
without making them execute anything.

A hashtable (which requires the type to have at least a
'hash' method) couldn't be compiled, as the compiler 
can know where the 'hash' method will be in the actual type !

That's why Eiffel has those type constraints: it's not a feature,
it's just necessary to be able to compile it separately ! (and to
typecheck separately also)

	Stefan

-----------------------------------------------------
-- On the average, people seem to be acting normal --
-----------------------------------------------------


