Andrey Semashev wrote:
I think Boost.Proto is one of the examples where undesired reference recursion happened.
Boost.Proto just uses cref in a generic context, where its argument sometimes happens to be a reference_wrapper. That's not undesired.
If not because of performance, conceptually there are no references to references in C++, and std::ref attempts to reflect that.
There are references to reference_wrapper though.
Now that Boost.Proto does reference collapsing, reverting the change will break it again (I think).
That's possible, but I don't think so.
I suspect that you don't actually have a motivating example in mind. Given
reference collapsing, how would you take advantage of it? What code have you
written, or will write, that needs it?
Do you realize that the simple use
#include