Re: Strange error

2021-03-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/21/21 3:18 AM, Jack Applegame wrote: Could someone please explain what is wrong with this code? https://glot.io/snippets/fwxn2198kv ```d import std.stdio; struct Sample{   void function() func1;   void function() func2; } void noth(Sample smpl)() {   smpl.func1(); // Error: expression

Re: Strange error

2021-03-21 Thread Jack Applegame via Digitalmars-d-learn
On Sunday, 21 March 2021 at 08:45:19 UTC, Imperatorn wrote: On Sunday, 21 March 2021 at 07:18:10 UTC, Jack Applegame wrote: Could someone please explain what is wrong with this code? https://glot.io/snippets/fwxn2198kv ```d import std.stdio; struct Sample{ void function() func1; void func

Re: Strange error

2021-03-21 Thread Imperatorn via Digitalmars-d-learn
On Sunday, 21 March 2021 at 07:18:10 UTC, Jack Applegame wrote: Could someone please explain what is wrong with this code? https://glot.io/snippets/fwxn2198kv ```d import std.stdio; struct Sample{ void function() func1; void function() func2; } void noth(Sample smpl)() { smpl.func1(); /

Strange error

2021-03-21 Thread Jack Applegame via Digitalmars-d-learn
Could someone please explain what is wrong with this code? https://glot.io/snippets/fwxn2198kv ```d import std.stdio; struct Sample{ void function() func1; void function() func2; } void noth(Sample smpl)() { smpl.func1(); // Error: expression __lambda1 is not a valid template value argu