Re: "is not an lvalue" when passing template function to spawn function

2023-11-09 Thread Bienlein via Digitalmars-d-learn
On Thursday, 9 November 2023 at 10:14:46 UTC, Bienlein wrote: On Thursday, 9 November 2023 at 09:40:47 UTC, Bienlein wrote: On Wednesday, 8 November 2023 at 16:47:02 UTC, Paul Backus wrote: On Wednesday, 8 November 2023 at 16:30:49 UTC, Bienlein wrote: ... The actual problem here is that you ca

Re: "is not an lvalue" when passing template function to spawn function

2023-11-09 Thread Bienlein via Digitalmars-d-learn
On Thursday, 9 November 2023 at 09:40:47 UTC, Bienlein wrote: On Wednesday, 8 November 2023 at 16:47:02 UTC, Paul Backus wrote: On Wednesday, 8 November 2023 at 16:30:49 UTC, Bienlein wrote: ... The actual problem here is that you can't take the address of a template without instantiating it fi

Re: "is not an lvalue" when passing template function to spawn function

2023-11-09 Thread Bienlein via Digitalmars-d-learn
On Wednesday, 8 November 2023 at 16:47:02 UTC, Paul Backus wrote: On Wednesday, 8 November 2023 at 16:30:49 UTC, Bienlein wrote: ... The actual problem here is that you can't take the address of a template without instantiating it first. To make your example work, replace `&addToBiz` with `&add

Re: "is not an lvalue" when passing template function to spawn function

2023-11-08 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 8 November 2023 at 16:30:49 UTC, Bienlein wrote: Hello, I get the error "`addToBiz(T)(Biz!T biz)` is not an lvalue and cannot be modified" when compiling the code below. Can't find a way how to do it right. Am a D newbie and would appreciate some help. [...] static void a

"is not an lvalue" when passing template function to spawn function

2023-11-08 Thread Bienlein via Digitalmars-d-learn
Hello, I get the error "`addToBiz(T)(Biz!T biz)` is not an lvalue and cannot be modified" when compiling the code below. Can't find a way how to do it right. Am a D newbie and would appreciate some help. Thank you, Bienlein class Biz(T) { private T value; this(T value) {