The OpenD Programming Language

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.

Parameters

T

the type to check qualifiers from

Return Value

The qualifier template from the given type T

Examples

static assert(__traits(isSame, QualifierOf!(shared const inout int), SharedConstInoutOf));
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));
import std.meta : Alias;
static assert(__traits(isSame, QualifierOf!(int), Alias));

Meta