Proposal: User Code Bug Tracking

Michal Minich michal.minich at gmail.com
Thu Nov 25 02:17:57 PST 2010


V Thu, 25 Nov 2010 01:32:36 +0000, dsimcha wrote:

> The root cause of my last D2 bug was closest to:

Signed/unsigned comparison and arithmetic

see http://www.digitalmars.com/d/archives/digitalmars/D/learn/
Mixing_operations_with_signed_and_unsigned_types_20347.html

to work around this bug, and get error at compile time you can create 
template for built in operators (< + - /): as 'lt' mentioned in the 
archived post, and use: lt(a, b) instead of a < b.

If it were not possible to make such templates, I would be hunting bugs 
in my sometime wrong/sometime not calculations to this day.

It is quite hard to avoid using unsigned types, especially when you are 
using auto.


More information about the Digitalmars-d mailing list