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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e93f73587e2bc1c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!k19g2000yqc.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Sharing generic bodies across instantiations. Date: Wed, 28 Jul 2010 13:03:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <97a2bf94-9b5b-40fb-abca-f64a2efef627@k19g2000yqc.googlegroups.com> References: <4c4e2d69$0$2378$4d3efbfe@news.sover.net> <4c4f5c28$0$2375$4d3efbfe@news.sover.net> <7da1e21f-bec7-4607-923c-0fd6cbcfc753@t10g2000yqg.googlegroups.com> <4c501408$0$2382$4d3efbfe@news.sover.net> <31fccf50-510e-4ca1-89b9-d267f3435ec5@d8g2000yqf.googlegroups.com> <4c505b89$0$2372$4d3efbfe@news.sover.net> NNTP-Posting-Host: 81.62.3.94 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1280347396 29298 127.0.0.1 (28 Jul 2010 20:03:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 28 Jul 2010 20:03:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k19g2000yqc.googlegroups.com; posting-host=81.62.3.94; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:12646 Date: 2010-07-28T13:03:16-07:00 List-Id: On 28 Lip, 18:32, "Peter C. Chapin" wrote: > The C++ community doesn't talk much > about a shared implementation of templates. Is that because it's just > unreasonably difficult in C++? Or maybe just pointless, regardless of the difficulty. I don't see any reason for doing it, really. The only possible reason would be to minimize the size of executable, possibly targeting some very constrained environment, but there are ways to do it more efficiently than with code sharing in templates - the technique, based on making a facade template implemented in terms of non-template actual code, was described by Scott Meyers, although at the moment I don't remember exactly which of his book covered it. The major advantage of this technique was *no performance penalty*. That is - small *and* fast code. In other words, the real reason for not having such compiler implementations might be that simply nobody needs them. Imagine yourself as a compiler vendor and try to answer a question if it makes sense to invest effort in this implementation strategy. If nobody asks for it, then probably not - and the market position of those Ada compilers that do it (code sharing) when compared to those that don't might indicate that this technique is not terribly shaking the Ada community either. -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4