Why do "const inout" and "const inout shared" exist?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 2 11:26:03 PDT 2017


On 7/2/2017 3:31 AM, Steven Schveighoffer wrote:
> On 7/2/17 5:15 AM, Walter Bright wrote:
>> On 7/1/2017 3:12 PM, Timon Gehr wrote:
>>> It used to be the case that const(inout(T)) = const(T),
>>
>> Anyone want to run git bisect and see when this changed? This would help in 
>> figuring out the rationale.
>>
>> Here's the code to test with it:
>>
>> inout(const char)* foo(inout(const(char))* p)
>> {
>>      pragma(msg, typeof(p));
>>      static assert(is(typeof(p) == const(char)*));
>>      return p;
>> }
> 
> https://issues.dlang.org/show_bug.cgi?id=6930
> 
> -Steve

Ah, thanks to you and Vladimir! This is just what I wanted to see.


More information about the Digitalmars-d mailing list