[Issue 21783] Add `if` as an operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 30 14:15:08 UTC 2021


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

--- Comment #2 from anonymous4 <dfj1esp02 at sneakemail.com> ---
bool conditional(bool c, bool check)
{
    return c?check:true;
}

    void divMod(int a, int b, int q, int r)
        in (b > 0)
        out (; conditional(a < 0, q <= 0))
        out (; conditional(a > 0, q >= 0))
        out (; conditional(a < 0, r <= 0))
        out (; conditional(a > 0, r >= 0))

--


More information about the Digitalmars-d-bugs mailing list