That `(1 ? (item) : (list)->payload)` was a neat trick. It gets optimized away, but the type comparison happens before that.
Still feels a bit like a party trick, but if it works...
Expressions that compile but never evaluate are bread and butter in C++ template metaprogramming.
It's somewhat of a forced trick nowadays, I think.
I actually thought from the title before I read the article that it was going to use _Generic, as in something like _Generic((item),__typeof__((list)->payload):...) .