Forwarding or merging 'this' into a child class to aid chaining methods?

Gary Willoughby dev at nomad.so
Thu Mar 6 13:02:00 PST 2014


On Thursday, 6 March 2014 at 19:16:07 UTC, anonymous wrote:
>
> 	public auto foo(this T)()
> 	{
> 		return cast(T) this;
> 	}
>
> http://dlang.org/template.html#TemplateThisParameter

Nice! This seems to be what i was after and it works well.


More information about the Digitalmars-d-learn mailing list