alias f = void delegate();
Tuple!(f)[] fs;
fs ~= tuple(() { });
fails but
fs ~= Tuple!(f)(() { });
passes.
in tuple, it is seeing the lambda as void and thinks I'm trying
to append a tuple of void. I don't see why the compiler can't see
that it works.
On Wednesday, 20 June 2018 at 11:43:52 UTC, DigitalDesigns wrote:
alias f = void delegate();
Tuple!(f)[] fs;
fs ~= tuple(() { });
fails but
fs ~= Tuple!(f)(() { });
passes.
in tuple, it is seeing the lambda as void and thinks I'm trying
to append a tuple of void. I don't see why the compiler
On Wednesday, June 20, 2018 11:43:52 DigitalDesigns via Digitalmars-d wrote:
> alias f = void delegate();
> Tuple!(f)[] fs;
>
> fs ~= tuple(() { });
>
> fails but
>
> fs ~= Tuple!(f)(() { });
>
> passes.
> in tuple, it is seeing the lambda as void and thinks I'm trying
> to append a tuple of void.
On Wednesday, 20 June 2018 at 12:08:28 UTC, Jonathan M Davis
wrote:
On Wednesday, June 20, 2018 11:43:52 DigitalDesigns via
Digitalmars-d wrote:
alias f = void delegate();
Tuple!(f)[] fs;
fs ~= tuple(() { });
fails but
fs ~= Tuple!(f)(() { });
passes.
in tuple, it is seeing the lambda as voi
On Wednesday, 20 June 2018 at 15:19:29 UTC, DigitalDesigns wrote:
See, what the compiler is not doing is realizing that a lambda
can be implicitly cast to any other lambda with the same
signature. If it understood that then it should have no problem
with casting the tuple implicitly.
Tuple!