Re: std.signals: Error: static assert: "Aliases to mutable thread-local data not allowed."

2022-07-21 Thread Bagomot via Digitalmars-d-learn
On Tuesday, 19 July 2022 at 05:24:55 UTC, frame wrote: On Monday, 18 July 2022 at 10:22:16 UTC, Bagomot wrote: Why can't I do it with `std.signals`? How the to do it if I can't create static event listeners? ```d public void addEventListener(T : EventListener)(T listener) { connect(&listener

Re: std.signals: Error: static assert: "Aliases to mutable thread-local data not allowed."

2022-07-18 Thread frame via Digitalmars-d-learn
On Monday, 18 July 2022 at 10:22:16 UTC, Bagomot wrote: Why can't I do it with `std.signals`? How the to do it if I can't create static event listeners? ```d public void addEventListener(T : EventListener)(T listener) { connect(&listener.watch); } ``` This error comes from somewhere else in

std.signals: Error: static assert: "Aliases to mutable thread-local data not allowed."

2022-07-18 Thread Bagomot via Digitalmars-d-learn
Why can't I do it with `std.signals`? How the to do it if I can't create static event listeners? ```d public void addEventListener(T : EventListener)(T listener) { connect(&listener.watch); } ```