disabling unary "-" for unsigned types
bearophile
bearophileHUGS at lycos.com
Wed Feb 17 12:43:37 PST 2010
Don:
> Steven Schveighoffer:
> > If unsigned types get used far more often than they should, then they shouldn't be all over the place in the standard language
> (i.e. size_t is used for everything size related).
>
> Yes, that's exactly my opinion. I think size_t being unsigned is the
> primary problem.
>
> You simply can't avoid using unsigned.
>
>
> It's also useful for when you don't think you should ever receive inputs
> that are negative.
> That's like using double for currency. You deserve what you get.
It seems you and Steven agree with what I am saying for some months (this is just the last I have written):
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=106381
By the way, I think in C# array indexes are signed:
http://msdn.microsoft.com/en-us/library/system.collections.arraylist.item.aspx
Bye,
bearophile
More information about the Digitalmars-d
mailing list