MutableOf etc and QualifierOf

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Wed Oct 21 05:37:22 PDT 2015


On Wednesday, 21 October 2015 at 12:22:25 UTC, Shriramana Sharma 
wrote:
> The templates `MutableOf` etc in std.traits – they don't seem 
> to be of any public use since `const(T)` is more direct and 
> meaningful than `ConstOf!T`.
>
> Except for `MutableOf` they are all currently public and even 
> the `package`- level `MutableOf` is publicly documented. All 
> this seems pointless.
>
> Of course they are used in the implementation of std.variant 
> but for that they all can be marked `package` and they don't 
> need to be publicly documented.
>
> They are also used for making the internal life of QualifierOf 
> easier, but QualifierOf itself is not publicly documented.
>
> Is QualifierOf intended to be publicly used? What is the 
> difference in final utility between QualifierOf and 
> CopyTypeQualifiers?
>
> Thanks!

It might be better to ask in http://forum.dlang.org/group/learn 
first for these sort of questions.

One reason is that it interacts with constructs like 
std.meta.staticMap, e.g.

alias constTypes(T ...) = staticMap!(ConstOf, T);


More information about the Digitalmars-d mailing list