Overflows in Phobos
Charles Hixson via Digitalmars-d
digitalmars-d at puremagic.com
Fri Jul 29 17:55:11 PDT 2016
On 07/26/2016 07:36 AM, ketmar via Digitalmars-d wrote:
> On Tuesday, 26 July 2016 at 14:28:48 UTC, Timon Gehr wrote:
>> "The expression assert(0) is a special case; it signifies that it is
>> unreachable code. [...] The optimization and code generation phases
>> of compilation may assume that it is unreachable code."
>
> so specs should be fixed. i bet everyone is using `assert(0);` to mark
> some "immediate error exit" cases.
>
FWIW, in that case I always use
assert (false, "...");
I try to never use integers for booleans. But this may well be a common
usage.
More information about the Digitalmars-d
mailing list