Preventing implicit conversion

ixid via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Nov 4 09:38:10 PST 2015


On Wednesday, 4 November 2015 at 17:26:04 UTC, Daniel Kozak wrote:
> V Wed, 04 Nov 2015 14:27:45 +0000
> ixid via Digitalmars-d-learn <digitalmars-d-learn at puremagic.com>
> napsáno:
>
>> Is there an elegant way of avoiding implicit conversion to int 
>> when you're using shorter types?
>
> http://dlang.org/phobos/std_typecons.html#.Typedef

That doesn't appear to prevent implicit conversion. Making two 
bools (or ubytes etc) that are Typedef and adding them together 
still results in an int.


More information about the Digitalmars-d-learn mailing list