isRef

Undocumented in source.
pure nothrow pragma(inline, true)
enum isRef (
alias fn
)

Examples

struct S { int x, y; }

static void f()(auto ref const S s)
{
    static assert(__traits(isRef, s));
}

static void g()(auto ref const S s)
{
    static assert(!__traits(isRef, s));
}

S s;
static assert(!__traits(isRef, s));

f(s);

g(S.init);

as hash table key

// TODO disabled until non-copyable types work in AA's
// string[Z] aa;
// aa[123.Z] = "abc";
// aa[456.Z] = "def";
// assert(aa[123.Z] == "abc");
// assert(aa[456.Z] == "def");

Meta