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

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Dec 14 16:02:02 PST 2012


On Fri, Dec 14, 2012 at 12:39:04AM -0800, Walter Bright wrote:
> On 12/13/2012 10:19 PM, H. S. Teoh wrote:
> >This is cool, I've never thought of using alias this on a @property
> >function. I'll have to start using that in my code. :-)
> 
> That's actually why I wrote it - as a "template" for how to do
> similar user defined types.
[...]

I'm so impressed by this trick that I decided to do a writeup of it on
the wiki:

	http://wiki.dlang.org/Implicit_conversions_in_user_types


T

-- 
If Java had true garbage collection, most programs would delete themselves upon execution. -- Robert Sewell


More information about the Digitalmars-d mailing list