3 ms·
why is this amazing? such macros have been around since the 80s. then we got various implementations of intrusive list in C++ and they became typesafe
by tokyodude 8y ago
why is this amazing? such macros have been around since the 80s. then we got various implementations of intrusive list in C++ and they became typesafe
- sagartewari01 8y agoYes, I suppose such use cases were the reason 'offsetof' was introduced. It's just that I wasn't taught any uses of macros other than trivial examples like `MIN` and `MAX`. That's why I found it interesting.
- IgorPartola 8y agoBecause most people haven’t seen it before? For people who program in languages in which this stuff isn’t possible, this pattern isn’t obvious. No need to dismiss it just because it’s obvious to you.
- bsenftner 8y agoI remember using it in C in '79...