On 12/24/19 8:52 AM, MoonlightSentinel wrote:
On Tuesday, 24 December 2019 at 07:37:02 UTC, Rumbu wrote:
I am trying to create an array of functions inside a struct.
struct S {
void f1() {}
void f2() {}
alias Func = void function();
immutable Func[2] = [, ]
}
What I got: Error:
On Tuesday, 24 December 2019 at 13:13:12 UTC, MoonlightSentinel
wrote:
On Tuesday, 24 December 2019 at 10:40:16 UTC, Mike Parker wrote:
struct S {}
void f1(S s) {}
void f2(S s) {}
alias Func = immutable(void function());
immutable Func[2] funcs = [cast(Func), cast(Func)];
Though, it's not
On Tuesday, 24 December 2019 at 07:37:02 UTC, Rumbu wrote:
I am trying to create an array of functions inside a struct.
struct S {
void f1() {}
void f2() {}
alias Func = void function();
immutable Func[2] = [, ]
}
What I got: Error: non-constant expression ''
Tried also with
On Tuesday, 24 December 2019 at 13:13:12 UTC, MoonlightSentinel
wrote:
On Tuesday, 24 December 2019 at 10:40:16 UTC, Mike Parker wrote:
struct S {}
void f1(S s) {}
void f2(S s) {}
alias Func = immutable(void function());
immutable Func[2] funcs = [cast(Func), cast(Func)];
Though, it's not
On Tuesday, 24 December 2019 at 10:40:16 UTC, Mike Parker wrote:
struct S {}
void f1(S s) {}
void f2(S s) {}
alias Func = immutable(void function());
immutable Func[2] funcs = [cast(Func), cast(Func)];
Though, it's not clear to me wy the one requires casting the
pointer type and the other
On Tuesday, 24 December 2019 at 07:37:02 UTC, Rumbu wrote:
I am trying to create an array of functions inside a struct.
struct S {
void f1() {}
void f2() {}
alias Func = void function();
immutable Func[2] = [, ]
}
What I got: Error: non-constant expression ''
Tried also with
On Tuesday, 24 December 2019 at 07:37:02 UTC, Rumbu wrote:
I am trying to create an array of functions inside a struct.
struct S {
void f1() {}
void f2() {}
alias Func = void function();
immutable Func[2] = [, ]
}
What I got: Error: non-constant expression ''
Tried also with
I am trying to create an array of functions inside a struct.
struct S {
void f1() {}
void f2() {}
alias Func = void function();
immutable Func[2] = [, ]
}
What I got: Error: non-constant expression ''
Tried also with delegates (since I am in a struct context but I
got: no `this` to