Thread overview | ||||||
---|---|---|---|---|---|---|
|
August 02, 2012 std.variant and delegate | ||||
---|---|---|---|---|
| ||||
Hi, std.variant with delegate seems to be buggy : http://dpaste.dzfl.pl/24a87b46 Why the output is not 42 ? Thx |
August 02, 2012 Re: std.variant and delegate | ||||
---|---|---|---|---|
| ||||
Posted in reply to Eyyub | On Thursday, 2 August 2012 at 20:33:02 UTC, Eyyub wrote:
> Hi,
>
> std.variant with delegate seems to be buggy : http://dpaste.dzfl.pl/24a87b46
>
> Why the output is not 42 ?
>
> Thx
writeln(*vastr.get!(typeof(() => 42)));
prints 42 ;)
|
August 02, 2012 Re: std.variant and delegate | ||||
---|---|---|---|---|
| ||||
Posted in reply to Namespace | On 08/02/2012 01:36 PM, Namespace wrote:
> On Thursday, 2 August 2012 at 20:33:02 UTC, Eyyub wrote:
>> Hi,
>>
>> std.variant with delegate seems to be buggy :
>> http://dpaste.dzfl.pl/24a87b46
>>
>> Why the output is not 42 ?
>>
>> Thx
>
> writeln(*vastr.get!(typeof(() => 42)));
> prints 42 ;)
And these:
a)
auto f = vastr.get!(typeof(() => 42));
writeln(f());
b)
writeln(vastr.get!(typeof(() => 42))()());
Ali
|
August 02, 2012 Re: std.variant and delegate | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ali Çehreli | On Thursday, 2 August 2012 at 20:36:53 UTC, Ali Çehreli wrote:
> On 08/02/2012 01:36 PM, Namespace wrote:
>> On Thursday, 2 August 2012 at 20:33:02 UTC, Eyyub wrote:
>>> Hi,
>>>
>>> std.variant with delegate seems to be buggy :
>>> http://dpaste.dzfl.pl/24a87b46
>>>
>>> Why the output is not 42 ?
>>>
>>> Thx
>>
>> writeln(*vastr.get!(typeof(() => 42)));
>> prints 42 ;)
>
> And these:
>
> a)
>
> auto f = vastr.get!(typeof(() => 42));
> writeln(f());
>
> b)
>
> writeln(vastr.get!(typeof(() => 42))()());
>
> Ali
Thanks guys, this is so ugly that I didn't think to do that ! :P
|
Copyright © 1999-2021 by the D Language Foundation