https://issues.dlang.org/show_bug.cgi?id=18380

[email protected] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from [email protected] ---
+1000! Having to write monstrosities like `b = cast(ubyte) -cast(int) b;` is
the one thing that ticked me off enough to start a forum discussion about it.

In any case, I've written an infectious wrapper type along the lines suggested
by Luis Marques (IIRC) that hides away this insane cast-o-mania, so I could
just write `b = -b.np` (np stands for No Promote[1], ie., it just truncates)
and it will Just Work(tm) without insanity-inducing nested casts.

[1] np can also stand for "no problem", as in, I don't have to care about
squint-inducing casts anymore. :-D

--

Reply via email to