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: 109fba,cd8ed9115942852f X-Google-NewGroupId: yes X-Google-Thread: 103376,b92b95c9b5585075 X-Google-NewGroupId: yes X-Google-Attributes: gid4f1905883f,gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-01.newsfeed.easynews.com!easynews!core-easynews-01!easynews.com!en-nntp-02.dc1.easynews.com.POSTED!not-for-mail From: Robert Wessel Newsgroups: comp.lang.c++,comp.lang.ada Subject: Re: Why use C++? Message-ID: References: <1e292299-2cbe-4443-86f3-b19b8af50fff@c29g2000yqd.googlegroups.com> <1fd0cc9b-859d-428e-b68a-11e34de84225@gz10g2000vbb.googlegroups.com> <9ag33sFmuaU1@mid.individual.net> <1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net> X-Newsreader: Forte Agent 6.00/32.1186 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@easynews.com Organization: Forte Inc. http://www.forteinc.com/apn/ X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly. Date: Fri, 12 Aug 2011 00:16:23 -0500 Xref: g2news1.google.com comp.lang.c++:82835 comp.lang.ada:20552 Date: 2011-08-12T00:16:23-05:00 List-Id: On Fri, 12 Aug 2011 00:02:55 -0500, "Randy Brukardt" wrote: >"Dmitry A. Kazakov" wrote in message >news:1d8wyhvpcmpkd.ggiui9vebmtl.dlg@40tude.net... >> 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. > >I'm not familar with any hardware on which saturated integer arithmetic is >provided. If it was, I would expect direct language support for it (which >need not require new kinds of types). Many DSPs, graphics coprocessors and the like have saturating integer arithmetic, usually in addition to conventional arithmetic. x86 has saturating integer vector instructions as well, dating back to MMX (PADDUSW, for example)..