Troubles creating templated inout objects
    Steven Schveighoffer 
    schveiguy at yahoo.com
       
    Thu Jul 12 12:32:02 UTC 2018
    
    
  
On 7/12/18 4:58 AM, Timoses wrote:
> On Tuesday, 10 July 2018 at 14:34:55 UTC, Timoses wrote:
>> `Unqual` in this case just turns `inout(int[])` into `inout(int)[]`, 
>> which is why it complains. That's a side effect of this example [...]
> 
> 
> See also:
> https://issues.dlang.org/show_bug.cgi?id=3567
Responded there, but really this is a misunderstanding of Unqual. Unqual 
should shallowly strip as much off as it can, but shouldn't allow you to 
break const.
The problem is that for things other than pointers or arrays, it can't 
provide a tail-const version, so it goes too far. Fixing this will 
probably break a lot of code, which means we need to find another way.
-Steve
    
    
More information about the Digitalmars-d-learn
mailing list