Casting lvalues

2021-04-02 Thread z via Digitalmars-d-learn
```d shared TT[] a; T processArray(T)(ref T[] p){/*...*/} //function calls .reserve on its parameter a.processArray; ``` Template *name* cannot deduce function from argument types !()(shared(T[]))... Even if the function is changed to only accept shared parameters, .reserve does not appear t

Re: Casting lvalues

2021-04-02 Thread z via Digitalmars-d-learn
On Friday, 2 April 2021 at 12:47:35 UTC, z wrote: ```d T processArray(T)(ref T[] p){/*...*/} //function calls .reserve ``` i meant `void` for the function return type.

Re: Casting lvalues

2021-04-02 Thread tsbockman via Digitalmars-d-learn
On Friday, 2 April 2021 at 12:47:35 UTC, z wrote: Even if the function is changed to only accept `shared` parameters, `.reserve` does not appear to support `shared` so the function is impossible to use without somehow changing its type or using `__gshared`. There is no way that `.reserve` can