static assert(is(SharedOf!int == shared int)); static assert(is(SharedOf!(const int) == const shared int)); static assert(is(SharedOf!(inout int) == inout shared int)); static assert(is(SharedOf!(shared int) == shared int)); // Note that shared has no effect on immutable, since immutable is // implicitly shared. static assert(is(SharedOf!(immutable int) == immutable int)); import phobos.sys.meta : AliasSeq, Map; alias Types = AliasSeq!(int, long, bool*, ubyte[], string, immutable(string)); alias WithShared = Map!(SharedOf, Types); static assert(is(WithShared == AliasSeq!(shared int, shared long, shared(bool*), shared(ubyte[]), shared(string), immutable(string))));
Applies shared to the given type.
This is primarily useful in conjunction with templates that take a template predicate (such as many of the templates in phobos.sys.meta), since while in most cases, you can simply do shared T or shared(T) to make T shared, with something like phobos.sys.meta.Map, you need to pass a template to be applied.