GDC adds intrinsic support for core.checkedint
rsw0x via Digitalmars-d
digitalmars-d at puremagic.com
Wed Jul 1 17:29:44 PDT 2015
On Wednesday, 1 July 2015 at 21:15:33 UTC, Robert burner Schadek
wrote:
> On Tuesday, 30 June 2015 at 20:24:38 UTC, tsbockman wrote:
>> 4. Robert has suggested that a SafeInt type should disable
>> bitwise operations like ~, &, |, ^, but I don't understand why.
>
> The name SafeInt and the missing bitwise operations go in
> tandem.
> SafeInt is a math type, +-/*% nothing more. Whenever I saw
> people beginning cleaver and use bitwise operations for math,
> they failed. Me included.
>
> Thats why
all bitwise ops except for shifting are fundamental math
operators just like addition and subtraction if you view an
integer as a bitstring(which is what it is...)
More information about the Digitalmars-d
mailing list