On Tue, Dec 11, 2012 at 7:05 PM, Peter Alexander <
[email protected]> wrote:

> That's the whole point. What you are doing is dangerous, so it requires
> the cast.
>


What I am doing is not dangerous. I am operating at byte/short level.
Tell me, if what I am doing is dangerous, how come doing the following is
not dangerous. It is allowed by D.

int a, b, c;
a = b + c;

Also the sense of safety that you get for short and byte too is not
complete. Consider:

void main() {
  import std.stdio;
  ushort a = ushort.max;
  ushort b = ushort.max;
  a += b;
  writeln(a);
}


Is it too much to ask for consistent behavior across the built-in types?

Regards
- Puneet

Reply via email to