Preventing implicit conversion

Maxim Fomin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Nov 4 21:06:43 PST 2015


On Wednesday, 4 November 2015 at 21:22:04 UTC, ixid wrote:
> On Wednesday, 4 November 2015 at 19:09:42 UTC, Maxim Fomin 
> wrote:
>> On Wednesday, 4 November 2015 at 14:27:49 UTC, ixid wrote:
>>> Is there an elegant way of avoiding implicit conversion to 
>>> int when you're using shorter types?
>>
>> Only with library solution. Implicit conversions are built 
>> into language.
>
> Doesn't that seem rather limiting and unnecessary?

Well, indeed it often produces confusion (this is inherited from 
C for compatibility purpose).


More information about the Digitalmars-d-learn mailing list