Newsgroups: comp.object,comp.lang.smalltalk,comp.lang.ada
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news4.ner.bbnplanet.net!news3.near.net!paperboy.wellfleet.com!news-feed-1.peachnet.edu!gatech!howland.reston.ans.net!news.sprintlink.net!news.wwa.com!rcm!rmartin
From: rmartin@rcmcon.com (Robert Martin)
Subject: Re: Has C++ had its day?
References: <NEWTNews.803919664.16092.sellers@sellers.sellers.com> <dewar.804000976@gnat> <Jan.Bytesmiths-2606951420580001@138.120.62.112> <1995Jun27.121935.4921@merlin.hgc.edu> <Jan.Bytesmiths-2806951021280001@138.120.62.112> <bill_law-2806951137080001@bill-law.taligent.com> <rshapiro-2806951805040001@esb.bbn.com>
Organization: R. C. M. Consulting Inc. 708-918-1004
Date: Thu, 29 Jun 1995 16:02:34 GMT
Message-ID: <1995Jun29.160234.5549@rcmcon.com>
Lines: 35
Xref: glinda.oz.cs.cmu.edu comp.object:33907 comp.lang.smalltalk:25190 comp.lang.ada:31882

rshapiro@bbn.com (R Shapiro) writes:

>In article <bill_law-2806951137080001@bill-law.taligent.com>,
>bill_law@taligent.com (William A. Law) wrote:

>>> languages who's notion of "type" is limited to
>>> compile-time inheritance.
>>
>>But C++ doesn't have such a limitation.  For example, what "types" do the
>>STL algorithms operate on? 

>The "types" referenced by templates are syntactic place-holders for real
>types, and the resolution is done completely at compile time.
>Semantically, there's no distinction at all between using a template on
>the one hand and manually writing out all the particular cases you
>actually use on the other. Templates certainly don't change the static
>(compile-time) nature of types in C++.

Yes, but this is like saying that there is no semantic difference
between a polymorphic method invocation and a typecase statement.  It
is true, but it misses the point.   C++ provides certain language
features (e.g.  templates) which provide a form of polymophism that is
not based upon types, but is based upon interface only.

To say this another way, The "type" conformance of a template argument
is not based upon inheritance.  It is only based upon whether the
actual argument posesses all the interfaces that the template
implementation uses.


-- 
Robert Martin       | Design Consulting   | Training courses offered:
Object Mentor Assoc.| rmartin@oma.com     |   OOA/D, C++, Advanced OO
2080 Cranbrook Rd.  | Tel: (708) 918-1004 |   Mgt. Overview of OOT
Green Oaks IL 60048 | Fax: (708) 918-1023 | Development Contracts.
