March 21

On Saturday, 2 March 2024 at 20:27:59 UTC, Walter Bright wrote:

>

https://github.com/dlang/dmd/pull/16280/files

Sometimes if you stare at code long enough, its underlying simplicity emerges.

The same if() blocks will be created for the switch case for the already generated assembly code; switch case can also be used if you're happy to see it this way:

with (Id) with (CppOperator)
{
    switch(id)
    {
        case _cast      : return Cast;
        case assign     : return Assign;
        case eq         : return Eq;
        case index      : return Index;
        case call       : return Call;
        case opUnary    : return Unary;
        case opBinary   : return Binary;
        case opOpAssign : return OpAssign;
        default         : return Unknown;
    }
}

SDB@79

1 2
Next ›   Last »