Implicit conversion from const to mutable

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Aug 17 14:44:36 PDT 2017


On 8/17/17 5:28 PM, Balagopal Komarath wrote:
> On Thursday, 17 August 2017 at 20:22:09 UTC, Steven Schveighoffer wrote:
>>
>> This should "work". I don't think your static assert will pass, but 
>> the main function below should run.
> 
> Thanks. But, isn't my static assert testing for exactly this?
> 

I might be wrong. It's hard to tell, because the compiler doesn't work 
with the struct itself.

If I change the alias this to something else, your form of conversion 
does work. But the compiler may recognize that specific form and still 
disallow it. IMO, that would be a further bug.

-Steve


More information about the Digitalmars-d-learn mailing list