Common type of ubyte and const ubyte is int

user1234 user1234 at 12.de
Thu May 2 17:30:12 UTC 2024


On Thursday, 2 May 2024 at 17:25:55 UTC, user1234 wrote:
> On Thursday, 2 May 2024 at 16:25:15 UTC, DrDread wrote:
>> I'm for not having types promote at all. it's been an endless 
>> source of bugs for me. it messes with metaprogramming.
>
> PLs that dont promote have their own problems too. The most 
> obvious is that overflowing is more easy. At least promotion 
> mitigates that.
>
> However I'm quite sure that D promotions rules were not seen as 
> such. It's more C compatibility, walking on the C tracks, to 
> speak metaphorically.

Just remembered, one argument that was once exposed by Walter is 
be that arithmetic instructions for 32 bits registers would be 
faster than the ones let's say for 16 or 8.


More information about the Digitalmars-d mailing list