On Sunday, 15 January 2017 at 17:41:36 UTC, Nordlöw wrote:
This

    struct S { int x, y; }
    void f()(auto ref const S s)
    {
        pragma(msg, "type:", typeof(s), " isRef:", isRef!s);
    }
    f(S.init);
    S s;
    f(s);

prints

    type:const(S) isRef:false
    type:const(S) isRef:true

given that

    enum isRef(alias fn) = __traits(isRef, fn);

:)

Reply via email to