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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b92b95c9b5585075 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news4.google.com!feeder.news-service.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Date: Thu, 11 Aug 2011 09:54:11 +0200 Organization: cbb software GmbH Message-ID: <1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net> References: <1e292299-2cbe-4443-86f3-b19b8af50fff@c29g2000yqd.googlegroups.com> <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com> <9ag33sFmuaU1@mid.individual.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: lf56Hr/Nx7cQs7KUwqjmjw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: g2news2.google.com comp.lang.c++:92561 comp.lang.ada:21498 Date: 2011-08-11T09:54:11+02:00 List-Id: On Wed, 10 Aug 2011 17:37:28 -0500, Randy Brukardt wrote: > There are uses for wrapping types, but they are far less likely than wanting > overflow detection. The default should be to catch errors, not turn them > into different ones. The OP mentioned image processing, the behavior frequently needed there is saturated integer arithmetic, which is nether ranged nor modular. As for modular types, wrapping is the mathematically correct behavior, it is not an error. You just cannot provide every possible arithmetic at the language level. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de