dmd foreach loops throw exceptions on invalid UTF sequences, use replacementDchar instead

rikki cattermole rikki at cattermole.co.nz
Thu Nov 4 12:32:38 UTC 2021


On 05/11/2021 12:59 AM, rikki cattermole wrote:
> 
> On 04/11/2021 8:51 PM, Elronnd wrote:
>> What is (potentially) questionable imo is that given foreach (c; a), c 
>> will be inferred to be dchar; you have to explicitly ask for char. 
>> Perhaps that default should be reversed.  (This will definitely break 
>> code, though, and may not be worth it.)
> 
> I think this is the right answer.
> 
> Fix the default. Less surprises, less head aches, everyone is happy.

Correction: the default is correct, I checked.


More information about the Digitalmars-d mailing list