On 03/06/2014 11:16 AM, anonymous wrote:

>      public auto foo(this T)()
>      {
>          return cast(T) this;
>      }
>
> http://dlang.org/template.html#TemplateThisParameter

Sweet! :) Unfortunately, it has a somewhat obfuscated definition: "TemplateThisParameters are used in member function templates to pick up the type of the this reference."

"type of the this reference" does not explain that it is about the type of the most derived object.

Ali

Reply via email to