[phobos] [Fwd: "Unsigned-related bugs never occur in real code."]

Sean Kelly sean at invisibleduck.org
Thu Jan 21 15:01:32 PST 2010

On Jan 21, 2010, at 9:58 AM, Andrei Alexandrescu wrote:

> Sean Kelly wrote:
>> Yeah, I was mostly responding to your earlier comment that casting didn't work for you. If you really wanted to cast it would be to ptrdiff_t anyway.
>> I agree that there's a more fundamental problem though. Weren't we going to make implicit narrowing conversions an error?  I know it isn't in the spirit of c, but c allows all sorts of horrible nonsense.
> Implicit narrowing conversions are already disabled. But code involving cast is explicit.

Sure, but if abs() took an int or long then it wouldn't compile without a cast, right?

More information about the phobos mailing list