Bring back foreach int indexes

deadalnix deadalnix at gmail.com
Tue Mar 26 15:03:05 UTC 2024


On Tuesday, 26 March 2024 at 04:17:17 UTC, harakim wrote:
> https://forum.dlang.org/post/ssqeqbnesbiostjrnxrf@forum.dlang.org
>
> On Wednesday, 29 November 2023 at 14:56:50 UTC, Steven 
> Schveighoffer wrote:
>> I don’t know how many times I get caught with size_t indexes 
>> but I want them to be int or uint. It’s especially painful in 
>> my class that I’m teaching where I don’t want to yet explain 
>> why int doesn’t work there and have to introduce casting or 
>> use to!int. All for the possibility that I have an array 
>> larger than 2 billion elements.
>> -Steve


Could we just insert a runtime check that the array isn't more 
than 2G elements in case an int is used as key?


More information about the Digitalmars-d mailing list