isRefDecl

True if it's a ref decleration. This applies to parameters and functions

Members

Manifest constants

isRefDecl
enum isRefDecl;
Undocumented in source.
isRefDecl
enum isRefDecl;
Undocumented in source.

Examples

bool checkRefParam()(auto ref int i) {
    return isRefDecl!i;
}

bool checkRefReturn() {
    ref int f(ref int i) {
        return i;
    }
    return isRefDecl!f;
}

bool checkMemberFunciton() {
    static struct S {
        int i;
        ref int value() return { return i; }
    }
    S s;
    return isRefDecl!(s.value) && isRefDecl!(S.value);
}

int i;
assert(        checkRefParam(i));
static assert(!checkRefParam(3));
static assert( checkRefReturn());
static assert( checkMemberFunciton());
static assert(!isRefDecl!int);
static assert(!isRefDecl!i);

Meta