October 10, 2014 Re: What is a sink delegate? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Hjkp | On Friday, 10 October 2014 at 11:35:21 UTC, Hjkp wrote: > On Friday, 10 October 2014 at 04:42:04 UTC, thedeemon wrote: >> On Friday, 10 October 2014 at 03:06:33 UTC, Joel wrote: >> >>> How do you use that toString? Maybe an example? >> >> void main() { >> Try t = Try("Joel", 35); >> t.toString(s => writeln(s)); >> } > > I think that the problem pointed by the OP is that toString is usually used automatically for struct in std.conv when it's implemented. I'm myself quite dubitatif in front of this syntax, even if IIRC during one talk of the DConf 2014 someone claim that's it's faster. I think it was in http://dconf.org/2014/talks/strasuns.html |
October 11, 2014 Re: What is a sink delegate? | ||||
---|---|---|---|---|
| ||||
Posted in reply to thedeemon | Thanks thedeemon.
On Friday, 10 October 2014 at 04:42:04 UTC, thedeemon wrote:
> On Friday, 10 October 2014 at 03:06:33 UTC, Joel wrote:
>
>> How do you use that toString? Maybe an example?
>
> void main() {
> Try t = Try("Joel", 35);
> t.toString(s => writeln(s));
> }
|
Copyright © 1999-2021 by the D Language Foundation