Behavior of __FILE__ in mixin template

Andre Pany via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jun 22 11:08:43 PDT 2016


On Wednesday, 22 June 2016 at 17:52:26 UTC, Ali Çehreli wrote:
> On 06/22/2016 10:07 AM, Andre Pany wrote:
> > Hi,
> >
> > I thought a mixin template is copied into the place where the
> mixin
> > statement
> > exists and then the coding is evaluated.
> > This seems not to be true for __FILE__
>
> Apparently its the whole template that supports that. Is moving 
> the 'file' parameter to the entire template acceptable?
>
> mixin template formTemplate(string file = __FILE__)
> {
>     // ...
> }
>
> Ali

Perfekt, thanks a lot.

Kind regards
André


More information about the Digitalmars-d-learn mailing list