Is there any reason why arithmetic operation on shorts and bytes return int?

d coder dlang.coder at gmail.com
Tue Dec 11 20:34:40 PST 2012


On Wed, Dec 12, 2012 at 9:07 AM, Denis Koroskin <2korden at gmail.com> wrote:

> What's now is safer than what you propose. You can always create your own
> data type that would automatically truncate result if you wish so.


:-)

I should not have used the word "safe" there. All I meant was "safer" than
C++ which allows implicit conversion form int to short and long to int.

Yes, I am now using my own User Type.

Regards
- Puneet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121212/ea44b7af/attachment.html>


More information about the Digitalmars-d mailing list