[Issue 3567] std.traits: Unqual strips qualifiers on structs with references that would break const/immutable.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 12 15:02:58 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=3567

--- Comment #8 from Timoses <timosesu at gmail.com> ---
(In reply to Steven Schveighoffer from comment #6)
> Note, the bug here in FeepingCreature's case is that it strips more than it
> should. It is supposed to be safe to use Unqual.
> 
> So the expectation that Unqual should remove all mutability modifiers is
> incorrect.

Tried to find examples where a complete stripping of qualifiers would break
something. I guess here it is really required that it only strips the "head"
qualifier:

https://github.com/dlang/phobos/blob/90a8fc387f25f9bdfc2c6ad4508da63c523be670/std/array.d#L1465

Though this is not the subject of this issue.. Should I perhaps create a new
issue for https://issues.dlang.org/show_bug.cgi?id=3567#c5 ? Perhaps asking for
a new trait?

--


More information about the Digitalmars-d-bugs mailing list