March 18, 2019 Re: Can't make inout work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Paul Backus | On Sunday, 17 March 2019 at 20:23:44 UTC, Paul Backus wrote: > On Sunday, 17 March 2019 at 10:49:03 UTC, aliak wrote: >> [...] > > For some reason, when you call `make("hello")`, the template argument T is being inferred as char[] instead of string. (You can see this by putting `pragma(msg, T)` in the body of make.) It works if you instantiate make explicitly with `make!string("hello")`. > > This seems like a bug to me. If you remove inout from the code, T is correctly deduced as string. https://issues.dlang.org/show_bug.cgi?id=19749 |
March 18, 2019 Re: Can't make inout work. | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kagamin | On 17/03/2019 18:34, Kagamin via Digitalmars-d-learn wrote:
> On Saturday, 16 March 2019 at 14:57:35 UTC, Paul Backus wrote:
>> This code fails to compile if you change `auto s2` to `const s2`--in other words, it has the same problem as the original example.
>
> Maybe there's not much need for qualifiers anyway.
This is what I meant as well.
diniz
|
Copyright © 1999-2021 by the D Language Foundation