DbI checked integral

Meta via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 25 16:50:22 PDT 2016


On Saturday, 25 June 2016 at 21:46:23 UTC, deadalnix wrote:
> On Saturday, 25 June 2016 at 14:38:43 UTC, Robert burner 
> Schadek wrote:
>> I think there is a major problem with the proposed design.
>>
>> when Checked!(int, void) is to behave as an int, why do we 
>> need it in the first place. I mean we have int as a basic 
>> type. Can't we do:
>>
>> alias Int = int;
>> alias Int = Checked!(int, SomeUsefulHook);
>>
>> On second thought, the only feature of Checked!(int, void) is 
>> to be a slower int ;-)
>>
>> IMO the default CheckedInt!(int, void) needs a NaN like 
>> init/failure state. After any operation that overflows the 
>> value should be NaN.
>
> IMO this is the same problem as for the test function with no 
> arguments.

The other thread Deadalnix is referring to, for context:
http://forum.dlang.org/thread/skqcudmkvqtejmofxoim@forum.dlang.org

Shameless plug: Andrei your input is needed


More information about the Digitalmars-d mailing list