On Saturday, 16 March 2019 at 14:57:35 UTC, Paul Backus wrote:
This code fails to compile if you change `auto s2` to `const s2`--in other words, it has the same problem as the original example.

Maybe there's not much need for qualifiers anyway.

struct S(T) {
    T value;
}

auto make(T)(ref T value) {
    return S!T(value);
}

auto f(T)(ref T s) {
    return make(s.value);
}

void f() {
    class C {}
    C c;
    auto s1 = S!C(c);
    const s2 = make!C(c);
    auto s3 = f(s2);
}

Reply via email to