super(...) in mixin template
John Colvin
john.loughran.colvin at gmail.com
Tue Mar 4 04:01:43 PST 2014
On Tuesday, 4 March 2014 at 10:37:02 UTC, Steve Teale wrote:
> On Tuesday, 4 March 2014 at 07:23:29 UTC, Jacob Carlborg wrote:
>>
>> Perhaps you already figured this out but template mixins can
>> only mixin declarations, not expression or statements.
>>
>> --
>> /Jacob Carlborg
>
> Damn! Yup, first sentence of the documentation. Wishful reading.
>
> Thanks.
> Steve
You can of course mixin a function (either nested inside the
constructor or as a member or even a free funtion) containing
whatever you want and then call that.
That won't help you with calling super() though, you can only
call super from another constructor. You'd have to use a string
mixin as that truly can inject arbitrary code.
More information about the Digitalmars-d
mailing list