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 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 05:20:02 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery Date: Wed, 26 Mar 2003 14:02:01 +0100 Message-ID: <8j838v81tn0t2ft4locfphs6tg6t7e1lvb@4ax.com> 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> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1048683721 80858982 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:35721 Date: 2003-03-26T14:02:01+01:00 List-Id: On Tue, 25 Mar 2003 15:22:10 -0500, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> Array is an old well known concept, which requires no baroque kinks. > >There are many old and well-known concepts. >Good programming languages allow you to build >them yourself instead of providing special >and unique support. I know such a language, one of the Turing machine. (:-)) >> Right, but not in C++, which is unable to handle unconstrained objects on >> the stack. > >True enough for now. I suspect C++ will eventually adopt a >form of C99's variable-length arrays, and then it will be >possible. Where supported, something could probably be >cobbled together with alloca. > >> But as you said it should not be slow. > >OO-style inheritance is the wrong concept for this. 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. >> your nasty proxy class will show itself. > > you will have to make it derived > >Nope. The function will be a generic, instantiated >automatically on the proxy class. 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. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de