View source code
Display the source code in std/traits.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Alias std.traits.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.

alias QualifierOf(T) = ImmutableOf;

Parameters

NameDescription
T the type to check qualifiers from

Returns

The qualifier template from the given type T

Example

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));

Authors

Walter Bright, Tomasz Stachowiak (isExpressions), Andrei Alexandrescu, Shin Fujishiro, Robert Clipsham, David Nadlinger, Kenji Hara, Shoichi Kato

License

Boost License 1.0.