tuple of delegates requires explicit type

2018-06-20 Thread DigitalDesigns via Digitalmars-d
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.

Re: tuple of delegates requires explicit type

2018-06-20 Thread Meta via Digitalmars-d
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

Re: tuple of delegates requires explicit type

2018-06-20 Thread Jonathan M Davis via Digitalmars-d
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.

Re: tuple of delegates requires explicit type

2018-06-20 Thread DigitalDesigns via Digitalmars-d
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

Re: tuple of delegates requires explicit type

2018-06-20 Thread ag0aep6g via Digitalmars-d
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!