flagging unsigned subtraction assigned to bigger signed number?

Steven Schveighoffer schveiguy at gmail.com
Thu May 22 01:32:03 UTC 2025


On Wednesday, 21 May 2025 at 20:53:13 UTC, Walter Bright wrote:
> In my not-so-humble opinion, every cast is a bug, as it breaks 
> the type system.

The problem isn't the cast, the problem is that is the tool D 
gives you to use for this kind of thing.

I somewhat agree -- I do not like pulling out cast for things 
like this. But the alternative is horrible (type constructor + 
bitwise and).

I think std.conv probably should have a `truncate` function that 
does the right thing.

-Steve


More information about the Digitalmars-d mailing list