From -2968735804922751936
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-05 17:45:12 PST
Xref: sparky comp.lang.c++:14569 comp.std.c++:1325
Path: sparky!uunet!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: <Yeo91je00awVE_zEkI@andrew.cmu.edu>
Date: 5 Oct 92 10:58:55 GMT
Article-I.D.: andrew.Yeo91je00awVE_zEkI
References: <RAYMOND.92Sep29122502@cobra.es.ele.tue.nl> <0enxJ1W00awTMNepU8@andrew.cmu.edu>
	<23808@alice.att.com>
Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
Lines: 44
In-Reply-To: <23808@alice.att.com>

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

> In article <0enxJ1W00awTMNepU8@andrew.cmu.edu>, osoelgaultier+@CMU.EDU
> (Stefan Monnier) writes:

> > 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'.

> But you still haven't answered my question.

> My question was: what reason do you have to believe that
> adding inheritance constraints would solve the problem?

> In thinking about the answer, don't forget about inline functions.
> -- 
> 				--Andrew Koenig
> 				  ark@europa.att.com


With inheritance constraints, you can restrict method calls
to those known to be present (through inheritance).
Inlining doesn't make it impossible: it's just harder, cause
you can't keep the compiled version in pure object code, but
you have to keep information on where are the 'parameters' used
in order to translate their use !

What I say is just that inheritance constraint permits to check
the file and compile it before using it !

Maybe inlining is harder to implement, but I personnally don't
care (I don't think it's important, and anyway, it is feasible)

One problem is with 'base' types (int, ...) as they don't inherit.
But I think it's not 'unovercomable' (what a great word, I'll have
to suggest it for introduction in the Harrap's)

	Stefan

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


