Magic Spells

  • + 0 comments

    You can use a local struct type to define a local function within a function:

    void counterspell(Spell *spell) {
        ...
        struct A {
            static size_t f(...) { ... }
        };
        size_t lcs = A::f(...);
        cout << lcs << endl;
    }