On Saturday, 10 December 2016 at 08:16:48 UTC, Is it possible to store different generic types? wrote:
On Saturday, 10 December 2016 at 08:09:00 UTC, Is it possible to store different generic types? wrote:
[...]
Okay the issue seem to be that D casts the left-hand argument to the same type as the right-hand argument.

So when ex. doing "targetX < x + width" then it actually does "targetX < cast(width_type)x + width"

Where as I'd believe the behavior should have been "targetX < x + cast(x_type)width"

Simply don't mix signed and unsigned types.
That is begging for trouble.
or convert them to the next highter signed type.
  • ... Is it possible to store different generic types? via Digitalmars-d
    • ... Is it possible to store different generic types? via Digitalmars-d
      • ... Stefan Koch via Digitalmars-d
        • ... Is it possible to store different generic types? via Digitalmars-d
          • ... Timon Gehr via Digitalmars-d
      • ... Ali Çehreli via Digitalmars-d
        • ... Is it possible to store different generic types? via Digitalmars-d
    • ... Timon Gehr via Digitalmars-d
      • ... bauss (wtf happend to my name took some old cached title LOL??) via Digitalmars-d

Reply via email to