hasUDA

Determines whether symbol has user-defined attribute attr attached to it.

template hasUDA (
alias symbol
alias attr
) {}

Members

Variables

hasUDA
enum bool hasUDA;
Undocumented in source.

Parameters

symbol

A symbol.

attr

User-defined attribute.

Return Value

$(D_KEYWORD true) if symbol has user-defined attribute attr, $(D_KEYWORD false) otherwise.

Examples

static struct Attr1
{
}
static struct Attr2
{
}
@Attr1 int a;
static assert(hasUDA!(a, Attr1));
static assert(!hasUDA!(a, Attr2));

See Also

Meta