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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!proxad.net!193.252.118.146.MISMATCH!news.wanadoo.fr!news.wanadoo.fr!not-for-mail Sender: obry@PASCAL Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1110329098.642196@athnrd02> <1110361741.551255@athnrd02> From: Pascal Obry Organization: Home - http://www.obry.net User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Date: 09 Mar 2005 11:07:10 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Date: 09 Mar 2005 11:07:13 CET NNTP-Posting-Host: 82.120.30.69 X-Trace: 1110362833 news.wanadoo.fr 11695 82.120.30.69:4490 X-Complaints-To: abuse@wanadoo.fr Xref: g2news1.google.com comp.lang.ada:8921 comp.lang.c++:44732 comp.realtime:1112 comp.software-eng:4672 Date: 2005-03-09T11:07:13+01:00 List-Id: Ioannis Vranos writes: > I suppose this run-time check is something like the one provided by .NET > (mentioned in another message of mine). Yes. It seems we have some difficulties to understand each others. We were discussing about wether the checks could be removed automatically by the compiler if possible. The Ada type systems gives more information to the compiler, the compiler can then make some more optimizations. > > ISO C++ speaking, one may use vector::at() which provides boundary checking, > however the aforementioned way is *always* 100% safe as well as the > following: *You* know that, but no compiler in the world knows. Static analysis is not possible in this case. ... > for(vector::iterator p= Data.begin(); p!=Data.end(); ++p) Pascal. -- --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.org --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595