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.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1cf653444208df72 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-13 08:05:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!ihug.co.nz!out.nntp.be!propagator-SanJose!in.nntp.be!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <9pgr68$7pu1@news.cis.okstate.edu> <3bbd6287.346843109@news.cis.dfn.de> <3bcbfda2.7486093@news.cis.dfn.de> <3bf0e265.74480421@News.CIS.DFN.DE> Subject: Re: ada vs. cpp Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Tue, 13 Nov 2001 11:05:41 EST Organization: http://www.newsranger.com Date: Tue, 13 Nov 2001 16:05:41 GMT Xref: archiver1.google.com comp.lang.ada:16414 Date: 2001-11-13T16:05:41+00:00 List-Id: In article <3bf0e265.74480421@News.CIS.DFN.DE>, Dmitry A. Kazakov says... >template class String {...}; > >Here the string bounds identify the type. Which has a nasty >consequence that String<1,10> and String<1,80> are two different >types. It should be noted that this is a *theoretical* example Dmitry is presenting. C++'s "string" class is *not* defined this way. It is rather a single instantiation of another template, and thus all objects of this class *are* the same type. Another thing I noticed with C++ templates is that instantiations that use the same parameters appear to actually *be* the same object, unlike how Ada generics work. That actually would help alleviate this problem a bit more than if you had the same problem in Ada. --- T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html No trees were killed in the sending of this message. However a large number of electrons were terribly inconvenienced.