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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9cccf6ef6149fdaa X-Google-Attributes: gid103376,public From: Florian Weimer Subject: Re: Ada Date: 2000/01/04 Message-ID: <874scu18cs.fsf@deneb.cygnus.argh.org>#1/1 X-Deja-AN: 568100397 References: <38620350.48F8FC08@gecm.com> <83tohh$q2s$1@nnrp1.deja.com> <83u8l0$5i5$1@nnrp1.deja.com> <84rd2f$snm$1@nntp3.atl.mindspring.net> Mail-Copies-To: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@cygnus.argh.org X-Trace: deneb.cygnus.argh.org 946978931 18477 192.168.1.2 (4 Jan 2000 09:42:11 GMT) Organization: Penguin on board User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.4 Mime-Version: 1.0 Reply-To: Florian Weimer NNTP-Posting-Date: 4 Jan 2000 09:42:11 GMT Newsgroups: comp.lang.ada Date: 2000-01-04T09:42:11+00:00 List-Id: Hyman Rosen writes: [Ada generics vs. C++ templates] > Is there something specific you believe you can not > do in C++ with regard to these abilities? I can't imagine anything which can't be done with C++ templates which you can do using Ada generics. (The opposite case is different, though, because of Ada's strong typing.) However, there are some shortcomings of C++ templates (at least that's my impression): You won't get reasonable error messages. For example, try instantiating a STL container with a reference type; most compilers will give you several kilobytes of error messages. The situation gets worse if you nest templates more deeply. Writing reusable templates in C++ is hard, because you have to be very careful not to use operations on the parametric types which aren't available in general. These restrictions are not enforced by the compiler unless you provide suitable instantiations.