digitalmars.D - MutableOf etc and QualifierOf
- Shriramana Sharma (14/14) Oct 21 2015 The templates `MutableOf` etc in std.traits – they don't seem to be of...
- John Colvin (7/22) Oct 21 2015 It might be better to ask in http://forum.dlang.org/group/learn
- Shriramana Sharma (8/14) Oct 21 2015 I didn't do that only because it concerns implemental details of Phobos
- John Colvin (8/22) Oct 21 2015 No, I meant that as an example of user code, not necessarily
- Shriramana Sharma (5/7) Oct 21 2015 Heh, I thought the library was supposed to provide what the basic langua...
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! --
Oct 21 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);
Oct 21 2015
John Colvin wrote:It might be better to ask in http://forum.dlang.org/group/learn first for these sort of questions.I didn't do that only because it concerns implemental details of Phobos which didn't seem to be learner material. I have just now separately posted an actual "I don't know why this doesn't work" question over there. I do use both fora for different things.One reason is that it interacts with constructs like std.meta.staticMap, e.g. alias constTypes(T ...) = staticMap!(ConstOf, T);But even then it's enough if these are marked `package`, no? --
Oct 21 2015
On Wednesday, 21 October 2015 at 14:27:45 UTC, Shriramana Sharma wrote:John Colvin wrote:No, I meant that as an example of user code, not necessarily something in phobos. It's just a convenience. Sure, the user could write alias constOf(T) = const(T); themselves, but for better or worse, it's in std.traits so they don't have to.It might be better to ask in http://forum.dlang.org/group/learn first for these sort of questions.I didn't do that only because it concerns implemental details of Phobos which didn't seem to be learner material. I have just now separately posted an actual "I don't know why this doesn't work" question over there. I do use both fora for different things.One reason is that it interacts with constructs like std.meta.staticMap, e.g. alias constTypes(T ...) = staticMap!(ConstOf, T);But even then it's enough if these are marked `package`, no?
Oct 21 2015
John Colvin wrote:for better or worse, it's in std.traits so they don't have to.Heh, I thought the library was supposed to provide what the basic language itself doesn't provide... --
Oct 21 2015