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!w31g2000yqb.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Sharing generic bodies across instantiations. Date: Thu, 29 Jul 2010 07:02:25 -0700 (PDT) Organization: http://groups.google.com Message-ID: <9ad8b242-fe4c-4871-8c0e-1f1ddec936c7@w31g2000yqb.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> <1vjqnwxhvr91j.3e8ryvkk8ezv$.dlg@40tude.net> <1e77bsd66fduw.dbrgbk4g2ce7$.dlg@40tude.net> <22db743d-ef73-40fe-886d-9730a2763eaa@c10g2000yqi.googlegroups.com> <5cljc8pc0gv0$.115t79rxo29vs$.dlg@40tude.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 1280412145 9089 127.0.0.1 (29 Jul 2010 14:02:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 29 Jul 2010 14:02:25 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: w31g2000yqb.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:12662 Date: 2010-07-29T07:02:25-07:00 List-Id: On 29 Lip, 10:03, "Dmitry A. Kazakov" wrote: > > We were talking about the nature of templates, not the nature of > > macros. > > Yep, and the point was that templates being by the nature marcos Paragraph, please. Otherwise this discussion is just hand-waving. > You are free to disagree I do. Templates are not macros, do not have the nature of macros, are not their siblings and have no other association with them. > > Even if we assume such a limitation of discussion, there is still > > nothing particular in the C++ standard that would prevent code sharing > > as an implementation strategy for templates. > > It would be technically meaningless, because the back-end tools down to the > linker and loader were unsuitable for this. First: C++ standard places no constraints on how the implementation is organized at the system level. Second: so, I understand, "the back-end tools down to the linker and loader" were more suitable to do it in Ada, right? > > Interestingly, macros cannot use this strategy by their definition. > > They perfectly can. No. 2.1 (C++ standard) defines the phases of translation - macro expansion is performed before syntactic and semantic analysis of tokens. In other words, macros are expanded even before the compiler gets a chance to realize that it compiles a C++ code. -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4