Is this possible somehow:

        int op(int r, int i)
        {
                static auto tbl = [&add, &sub, &mul];
                goto tbl[i % 3];
        
                add:
                        r++;
                        goto end;
                sub:
                        r--;
                        goto end;
                mul:
                        r*=r;
                        goto end;
                end:
                return r;
        }

Happy holidays!
BR
/HF


Reply via email to