Comment by __phantomderp
1 month ago
For what it's worth, that is the primary feature of the proposal linked in the blog post. It's just not talked about in the post because that post is about... performance!
https://thephd.dev/_vendor/future_cxx/papers/C%20-%20Functio...
That actually goes a bit further than my suggestion, since it allows the closure to be returned with its unique type. I'm not a fan of introducing these "unnamable types" to C since it means the closure producing function cannot be declared in a header.
I do like the trampoline trick in 3.2.4, however, neat alternative to a fat pointer!