Thread overview | |||||
---|---|---|---|---|---|
|
September 05, 2008 Template mixins | ||||
---|---|---|---|---|
| ||||
This is probably a stupid question, but I cannot get a simple mixin to work: template Test(R, N=char[]) { mixin(R.stringof~" "~N~"() { return "~R.stringof~".init; }"); } class C { mixin Test!(bool, "T"); } gives: mixin Test!(bool, "T") does not match any template declaration So there's obviously some basic stuff I don't get here... |
September 05, 2008 Re: Template mixins | ||||
---|---|---|---|---|
| ||||
Posted in reply to Simen Haugen | On Fri, Sep 5, 2008 at 6:29 AM, Simen Haugen <simen@norstat.no> wrote:
> This is probably a stupid question, but I cannot get a simple mixin to work:
>
> template Test(R, N=char[])
> {
> mixin(R.stringof~" "~N~"() { return "~R.stringof~".init; }");
> }
You mean "template Test(R, char[] N)".
|
September 05, 2008 Re: Template mixins | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote:
> On Fri, Sep 5, 2008 at 6:29 AM, Simen Haugen <simen@norstat.no> wrote:
>> This is probably a stupid question, but I cannot get a simple mixin to work:
>>
>> template Test(R, N=char[])
>> {
>> mixin(R.stringof~" "~N~"() { return "~R.stringof~".init; }");
>> }
>
> You mean "template Test(R, char[] N)".
Aaah. Because I'm not sending a type, but a value. Thanks!
But I was right.. It was a stupid question :)
|
Copyright © 1999-2021 by the D Language Foundation