The first thing that comes to my mind is applying this somehow to the (T) vs (ref T) function problem. (const ref, scope ref, references to r-values, you know the problem.) At the moment I just follow this pattern.

void foo(ref const T bar) {
    /* ... */
}

// Second overload to make r-values just work.
void foo(const T bar) {
    foo(bar);
}

auto ref sometimes works, sometimes it's more trouble than its worth.

Reply via email to