From 7287584591094379548
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-06 06:28:02 PST
Xref: sparky comp.std.c++:1330 comp.lang.c++:14602
Newsgroups: comp.std.c++,comp.lang.c++
Path: sparky!uunet!gumby!wupost!decwrl!borland.com!pete
From: pete@genghis.borland.com (Pete Becker)
Subject: Re: The concept of templates considered ill designed
Message-ID: <1992Oct6.174129.10404@genghis.borland.com>
Originator: pete@genghis.borland.com
Sender: news@borland.com (News Admin)
Organization: Borland International
References: <1992Oct5.160022.29224@genghis.borland.com> <1992Oct6.020042.11130@cadsun.corp.mot.com>
Date: Tue, 6 Oct 1992 17:41:29 GMT
Lines: 32

In article <1992Oct6.020042.11130@cadsun.corp.mot.com> shang@corp.mot.com writes:
>In article <1992Oct5.160022.29224@genghis.borland.com> pete@genghis.borland.com  
>(Pete Becker) writes:
>> 
>> 	But this has very little to do with templates.  Constrained parameters
>> and no further knowledge of the actual type is equivalent, as far as I can 
>> see, to simply carrying around a pointer to the actual class, and dealing 
>> with it only through the known interface.  You don't need templates to 
>> implement this, and I don't see that there's anything gained by using the 
>> template mechanism to do it.
>
>Really? In my O-O design experience, it is very common to have a generic 
>model which is composed of several sub-models:
>
>   M < SM1, SM2, SM3 >
>
>and then use the genric model to produce another generic model M':
>
>   M' < SM1', SM2', SM3' >
>
>with more detailed specification.

	I seem to have not made myself clear.  What I was responding to was
the claim that constrained parameters ALLOW THE TEMPLATE DEFINITION TO BE
COMPILED INDEPENDENTLY OF ANY PARTICULAR INSTANTIATION.  While that's
certainly true, it offers very little beyond what's currently available
without using templates, precisely because the compiler knows nothing about
the actual types of the template parameters.
	If you want constrained templates AND independent compilation of
template definitions, you've already got it.  But don't call it a template.
Call it a forwarding class.
	-- Pete


