From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-26 07:06:53 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!spool0900.news.uu.net!reader0900.news.uu.net!not-for-mail Date: Wed, 26 Mar 2003 10:06:41 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030313 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery References: <4dkea.75440$gi1.38045@nwrdny02.gnilink.net> <1048524746.273345@master.nyc.kbcfp.com> <1048530794.5794@master.nyc.kbcfp.com> <1048623730.801824@master.nyc.kbcfp.com> <8j838v81tn0t2ft4locfphs6tg6t7e1lvb@4ax.com> In-Reply-To: <8j838v81tn0t2ft4locfphs6tg6t7e1lvb@4ax.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1048691202.136151@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1048691203 reader0.ash.ops.us.uu.net 6057 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:35728 Date: 2003-03-26T10:06:41-05:00 List-Id: Dmitry A. Kazakov wrote: > Wrong for what? There is no other way to specify a type set other than > through closures of a subtyping relation. That's what inheritance is > about. Yes there is. We've been through all this before. The other way is through use patterns. > Let you declare: > void Foo (Element& X); > then A[i] have to be of Element type to allow substitutability: > > Foo (A [i]); > If A [i] is of some proxy class then you need ether to make the class > a subtype of Element, or to write a wrapper for Foo. No, you declare template void Foo(Element &X); and you just call Foo(A[i]); As long as the proxy class has all of the operations that Foo uses, everything works fine. No inheritance is used. Please, let's not recapitulate the whole inheritance vs. generics thread.