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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,243dc2fb696a49cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: "Robert Kawulak" Newsgroups: comp.lang.ada Subject: Re: Ada Popularity: Comparison of Ada/Charles with C++ STL (and Perl) Date: Fri, 15 Oct 2004 11:25:03 +0200 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: <41547dae$0$91007$39cecf19@news.twtelecom.net> <1g2d9xmnita9f.5ecju0eftkqw$.dlg@40tude.net> <1hl2mizeb27ku$.1f0asrbmb05mi.dlg@40tude.net> <7siml3c62lev$.usczt2y2l19c$.dlg@40tude.net> <15fk5715wm38q.3ie9r3bq8yuz$.dlg@40tude.net> <1ob4dexep087b$.ul8fb1ebgeok.dlg@40tude.net> <1dzt37oj3dnah.bwalpmfvyxd3$.dlg@40tude.net> <1k2m0s9456ba7$.t0euzv9ux97l$.dlg@40tude.net> NNTP-Posting-Host: pd216.krakow.cvx.ppp.tpnet.pl X-Trace: atlantis.news.tpi.pl 1097833077 3582 213.76.39.216 (15 Oct 2004 09:37:57 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Fri, 15 Oct 2004 09:37:57 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-RFC2646: Format=Flowed; Original Xref: g2news1.google.com comp.lang.ada:5245 Date: 2004-10-15T11:25:03+02:00 List-Id: Hi, >>> In C++ it is checked upon inlining. In Ada it is checked upon >>> instantiation. With my proposal it will be checked when you create a >>> wrapper. The only difference is in the place and time. >> >> What do you mean by 'inlining' here? C++ templates are also >> instantiated, either explicitly or implicitly (in a place you use it). > > I prefer "inline" because C++ instantiation may fail due to errors in the > template body. That is because C++ templates are in fact macros. When and > if, C++ will switch to a contract model, then I will call it > instantiation. Still I don't get it - what's wrong in that "C++ instantiation may fail due to errors in the template body"? Why shouldn't it fail? (Actually compilation may fail even when there's no instantiation, because templates bodies are always parsed, templates are not only ^C^V or #define as you say ;-) And what would this "contract model" change? Nota bene, you can have contracts with templates - if you use some inappropriate type as template's parameter, it won't compile, and you can strenghten contracts using boost::concept_check and boost::type_traits mentioned before in this discussion. Regards, Robert