Robert Jacques wrote:
On Tue, 07 Jul 2009 03:33:24 -0400, Andrei Alexandrescu <[email protected]> wrote:
Robert Jacques wrote:
BTW: this means byte and short are not closed under arithmetic operations, which drastically limit their usefulness.

I think they shouldn't be closed because they overflow for relatively small values.

Andrei, consider anyone who want to do image manipulation (or computer vision, video, etc). Since images are one of the few areas that use bytes extensively, and have to map back into themselves, they are basically sorry out of luck.

Wrong example: in most cases, when doing image manipulations, you don't want the overflow to wrap but instead to be clipped. Having the compiler notify you when there is a risk of an overflow and require you to be explicit in how you want it to be handled is actually a good thing IMO.

                Jerome
--
mailto:[email protected]
http://jeberger.free.fr
Jabber: [email protected]

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to