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!t10g2000yqg.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Sharing generic bodies across instantiations. Date: Wed, 28 Jul 2010 00:59:03 -0700 (PDT) Organization: http://groups.google.com Message-ID: <7da1e21f-bec7-4607-923c-0fd6cbcfc753@t10g2000yqg.googlegroups.com> References: <4c4e2d69$0$2378$4d3efbfe@news.sover.net> <4c4f5c28$0$2375$4d3efbfe@news.sover.net> NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1280303943 5741 127.0.0.1 (28 Jul 2010 07:59:03 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 28 Jul 2010 07:59:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: t10g2000yqg.googlegroups.com; posting-host=137.138.182.236; 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:12622 Date: 2010-07-28T00:59:03-07:00 List-Id: On 28 Lip, 00:23, "Peter C. Chapin" wrote: > In contrast I have the impression that in C++ it is not really possible, > or at least not feasible, for a compiler to share template bodies across > instantiations. Why? > That is, the nature of C++ essentially requires a > replication strategy. Why? What part of that "nature" requires it? >From the point of view of object model and execution model, C++ and Ada are very similar. Compilation and deployment strategies are more or less equivalent. > To be honest I'm not sure why I think this and I > might be wrong. To be honest I'm not sure why you came up with such an idea. Formally, the C++ standard places no restrictions on how this should be done. > This isn't a C++ group so it's probably not appropriate > to explore C++'s issues in too much detail here, Don't worry, C and C++ are a frequent target of criticism here, so we might as well discuss some details from time to time. ;-) > but I will say that > haven't heard any serious talk in the C++ community about > implementations sharing template bodies. Because the code-expansion model is easier to implement and that's what most (all?) compiler vendors chosen to do. But, for the sake of exercise, think about a C++ *interpreter*. -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4