DbI checked integral

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 25 17:46:27 PDT 2016


On 6/25/16 7:50 PM, Meta wrote:
> 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

I'm okay with eliminating the zero-parameters version following an 
appropriate deprecation cycle. It's probably useless. -- Andrei


More information about the Digitalmars-d mailing list