bearophile can say "i told you so" (re uint->int implicit conv)

Jonathan M Davis jmdavisProg at gmx.com
Thu Mar 28 18:17:46 PDT 2013


On Thursday, March 28, 2013 15:11:02 H. S. Teoh wrote:
> Maybe it's time to introduce cast(signed) or cast(unsigned) to the
> language, as bearophile suggests?

It's not terribly pretty, but you can always do this

auto foo = cast(Unsigned!(typeof(var))var;

or

auto bar = to!(Unsigned!(typeof(var)))(var);

- Jonathan M Davis


More information about the Digitalmars-d mailing list