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,25b9eb5c3a89bced X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: where exactly c++,c fail and Ada gets thru' Date: Wed, 26 Apr 2006 17:10:54 +0200 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: <1145852356.559455.222600@i39g2000cwa.googlegroups.com> <1145855124.720029.35280@t31g2000cwb.googlegroups.com> NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1146064253 163 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla Thunderbird 1.0.8-1.4.1.SL (X11/20060424) X-Accept-Language: en-us, en In-Reply-To: <1145855124.720029.35280@t31g2000cwb.googlegroups.com> Xref: g2news2.google.com comp.lang.ada:3934 Date: 2006-04-26T17:10:54+02:00 List-Id: Hi, jimmaureenrogers@worldnet.att.net wrote: > The C standard explicitly > allows one to access one element beyond the end of an array to > support common practice in thousands of C programs. The "access" word is misleading. It's allowed to use such address for comparisons and in arithemtics. It is *not* allowed to dereference it. > Polymorphism is one of the heavily used features of C++. But it is not forced (as is the case in some other "OO" languages). It is perfectly possible to write programs without the use of run-time polymorphism. > Safety > critical software standards require the ability to statically > determine which function will be called. It's possible to write such programs in C++. > Neither C nor C++ provides any standard means for detecting > overflow or underflow of numeric types. That's true. > C provides no way to > ensure that a numeric type uses only a valid set of values. True. > C++ > forces you to define a class wrapping the numeric value. Yes, classes are used to define new types. Is there any problem with this? It is also necessary in Ada if we want to do just a bit more of what is provided by type and subtype constructs. > You > must also provide all the range checking, resulting in a very > inefficient use of programmer time as well as processor time. Depends. The former can be automated and the latter can be statically elided. It's all the question of how it's done and templates provide a powerful mechanism that can help here. > C++ allows you to define a restricted range integer class as a > template. It does not allow you to define a restricted range > floating point class because you cannot use floating point > values as template parameters. That's true - at least if you require direct use of floating point. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/