Comment

Comment by glouwbug

Maybe not then, but we basically have our own poor man's template system now:

    #define array(T, N) struct array##T##N { T value[N]; }

    void copy(array(int, 32)* x, array(int, 32)* y) {
        *x = *y;
    }

    int main() {
        array(int, 32) x;
        array(int, 32) y = { 1, 2, 3, 4 };
        copy(&x, &y);
    }
With (rumors of) lambdas and defer on the way, C is going the way of classic WoW.

https://en.wikipedia.org/wiki/C29_(C_standard_revision)

parent glouwbug 1 month ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton