static array with inferred size

Dominikus Dittes Scherkl Dominikus.Scherkl at continental-corporation.com
Fri Sep 22 07:55:26 UTC 2017


On Thursday, 21 September 2017 at 13:58:14 UTC, Timon Gehr wrote:
> On 21.09.2017 12:33, Per Nordlöw wrote:
>> On Wednesday, 20 September 2017 at 18:41:51 UTC, Timon Gehr 
>> wrote:
>>>> Can that be done without breakages? -- Andrei
>>>
>>> No.
>> 
>> Are thinking about
>> 
>>      typeof([1,2])
>> 
>> changing from
>> 
>>      int[]
>> 
>> to
>>      int[2]
>> 
>> ?
>
> Yes, and everything that entails, for example:
>
> auto x = [1,2];
> x ~= 3; // goes from ok to `error: cannot append int to int[2]`.

Ok, breaks code, but I like it. Much better than the current 
behaviour.


More information about the Digitalmars-d mailing list