isUnsafe

true if func is @system.

template isUnsafe (
alias func
) {
enum isUnsafe;
}

Examples

@safe    int add(int a, int b) {return a+b;}
@trusted int sub(int a, int b) {return a-b;}
@system  int mul(int a, int b) {return a*b;}

static assert(!isUnsafe!add);
static assert(!isUnsafe!sub);
static assert( isUnsafe!mul);

Meta