comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <no.spam@no.spam.com>
Subject: Re: where exactly c++,c fail and Ada gets thru'
Date: Wed, 26 Apr 2006 17:10:54 +0200
Date: 2006-04-26T17:10:54+02:00	[thread overview]
Message-ID: <e2o2ht$53$1@sunnews.cern.ch> (raw)
In-Reply-To: <1145855124.720029.35280@t31g2000cwb.googlegroups.com>

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/



  parent reply	other threads:[~2006-04-26 15:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24  4:19 where exactly c++,c fail and Ada gets thru' Ananth the Boss
2006-04-24  5:05 ` jimmaureenrogers
2006-04-24  7:45   ` Ananth the Boss
2006-04-24 19:17   ` Martin Krischik
2006-04-24 20:23   ` Simon Wright
2006-04-24 22:34     ` Keith Thompson
2006-04-24 22:33   ` Keith Thompson
2006-04-25  5:23     ` Jeffrey R. Carter
2006-04-26 17:48     ` Martin Krischik
2006-04-26 19:33       ` Keith Thompson
2006-04-26 15:10   ` Maciej Sobczak [this message]
2006-04-26 17:32     ` Martin Krischik
2006-04-27 10:07       ` Maciej Sobczak
2006-04-27 21:19         ` Keith Thompson
2006-04-28  7:00         ` Martin Krischik
2006-04-28 12:27           ` Maciej Sobczak
2006-04-29  7:03             ` Martin Krischik
2006-04-29 14:08               ` REH
2006-05-01 10:20                 ` Xcriber51
2006-05-01 13:55                   ` REH
2006-05-02  6:43               ` Maciej Sobczak
2006-04-27 16:48       ` REH
2006-04-28  7:49         ` Martin Krischik
2006-04-28 11:17           ` REH
2006-04-29  6:47             ` Martin Krischik
2006-04-24  8:13 ` Rod Chapman
2006-04-25  1:57 ` Steve
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox