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,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-07 20:24:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!uunet!sea.uu.net!sac.uu.net!ash.uu.net!spool0901.news.uu.net!spool0900.news.uu.net!reader0900.news.uu.net!not-for-mail Date: Tue, 07 Jan 2003 23:24:34 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. References: <3E147D79.2070703@cogeco.ca> <4519e058.0301031434.51a0c880@posting.google.com> <3chl1vg7p83jlgcgjndaa8n5lnh11a3l5t@4ax.com> In-Reply-To: <3chl1vg7p83jlgcgjndaa8n5lnh11a3l5t@4ax.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1041999874.693157@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: 1041999875 reader0.ash.ops.us.uu.net 10921 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:32723 Date: 2003-01-07T23:24:34-05:00 List-Id: Dmitry A. Kazakov wrote: > Shared bodies are working against the C++'s myth about unbeatable > efficience of templates. Do you have any evidence that this is a myth, rather than a fact? That is, in the C++ model of generics, the compiler has all the type information available at the point where it is compiling the code, so it's hard to see how any other model can be *more* efficient. So the best you can hope for is to be as efficient. I think of the canonical case as being std::sort, which can inline comparison between objects, so sorting an array of integers involves just doing an inline machine integer compare. Not only that, but the C++ model allows for specialization, so that the body of code in question does not all have to come from the same block of generic code - there can be completely different bodies for different types. This makes generic sharing even less likely there.