QualifierOf

Gives a template that can be used to apply the same attributes that are on the given type T. E.g. passing inout shared int will return SharedInoutOf.

template QualifierOf (
T
) {}

Parameters

T

the type to check qualifiers from

Return Value

The qualifier template from the given type T

Examples

static assert(__traits(isSame, QualifierOf!(immutable int), ImmutableOf));
static assert(__traits(isSame, QualifierOf!(shared int), SharedOf));
static assert(__traits(isSame, QualifierOf!(shared inout int), SharedInoutOf));

Meta

Suggestion Box / Bug Report