But I don't think there's any need to differentiate between different captures. Capture by value is enough because what do you need in C if you need a reference? Capture the value of the pointer.
That's an interesting point, and very C-like. You're right that capture-by-value can emulate capture-by-reference.
Capture-by-value does have a weakness though, in that it requires allocation (whether stack or heap). Capture-by-reference doesn't have any storage overhead.
In my example, I suggested having both. But if we had to pick only one, capture-by-value would be the one to use.
But I don't think there's any need to differentiate between different captures. Capture by value is enough because what do you need in C if you need a reference? Capture the value of the pointer.
This would allow you to operate on the value both from the defer declaration time and defer execution time, whichever it is that you need.