On Wednesday, 8 December 2021 at 17:05:49 UTC, Timon Gehr wrote:
```d
import std.stdio, std.traits, core.lifetime;
auto partiallyApply(alias fun,C...)(C context){
return class(move(context)){
C context;
this(C context) { foreach(i,ref c;this.context)
c=move(context[i]); }
On Wednesday, 8 December 2021 at 17:05:49 UTC, Timon Gehr wrote:
On 12/8/21 9:07 AM, Petar Kirov [ZombineDev] wrote:
[...]
Nice, so the error message is lying.
Closure support deserves way more love in the compiler. I'm quite
surprised that that hack worked, given that various very similar
On Wednesday, 8 December 2021 at 12:17:42 UTC, Stanislav Blinov
wrote:
On Wednesday, 8 December 2021 at 08:07:59 UTC, Petar Kirov
[ZombineDev] wrote:
```d
interface ICallable
{
void opCall() const;
}
alias Action = void delegate();
struct A
{
Action[] dg;
}
```
At this point why
On 12/8/21 9:07 AM, Petar Kirov [ZombineDev] wrote:
On Wednesday, 8 December 2021 at 07:55:55 UTC, Timon Gehr wrote:
On 08.12.21 03:05, Andrey Zherikov wrote:
On Tuesday, 7 December 2021 at 18:50:04 UTC, Ali Çehreli wrote:
I don't know whether the workaround works with your program but that
On Wednesday, 8 December 2021 at 08:07:59 UTC, Petar Kirov
[ZombineDev] wrote:
```d
interface ICallable
{
void opCall() const;
}
alias Action = void delegate();
struct A
{
Action[] dg;
}
```
At this point why not just call a spade a spade and store an
array of ICallables directly?
On Wednesday, 8 December 2021 at 07:55:55 UTC, Timon Gehr wrote:
On 08.12.21 03:05, Andrey Zherikov wrote:
On Tuesday, 7 December 2021 at 18:50:04 UTC, Ali Çehreli wrote:
I don't know whether the workaround works with your program
but that delegate is the equivalent of the following struct
On 08.12.21 03:05, Andrey Zherikov wrote:
On Tuesday, 7 December 2021 at 18:50:04 UTC, Ali Çehreli wrote:
I don't know whether the workaround works with your program but that
delegate is the equivalent of the following struct (the struct should
be faster because there is no dynamic context
On Tuesday, 7 December 2021 at 18:50:04 UTC, Ali Çehreli wrote:
I don't know whether the workaround works with your program but
that delegate is the equivalent of the following struct (the
struct should be faster because there is no dynamic context
allocation). Note the type of 'dg' is changed
On 12/7/21 7:30 AM, Andrey Zherikov wrote:
> auto createDelegate(string s)
> {
> return { s.writeln; }; // Error: closures are not yet
> supported in CTFE
> }
I don't know whether the workaround works with your program but that
delegate is the equivalent of the following struct (the
I have a struct `A` that stores delegates. The problem is that
I'm getting "`Error: closures are not yet supported in CTFE`" if
I create an compile-time constant value of type `A`:
```d
struct A
{
void delegate()[] dg;
}
auto createDelegate(string s)
{
return { s.writeln; }; //
10 matches
Mail list logo