Re: Some help on Mixin Template at Class level.

2011-05-23 Thread Matthew Ong
On 5/23/2011 2:17 AM, Simen Kjaeraas wrote: On Sat, 21 May 2011 11:40:22 +0200, Matthew Ong on...@yahoo.com wrote: Using your code I have this error: src\Sample.d(16): Error: undefined identifier btype, did you mean template AType(string name,U,alias V)? src\Sample.d(16): Error: mixin

Re: Some help on Mixin Template at Class level.

2011-05-23 Thread Andrej Mitrovic
On 5/23/11, Matthew Ong on...@yahoo.com wrote: Someone also pointed out: template mydef(string name){ } mixin(mydef!(abc)); The above are NOT shown up left hand side of that when we click on Language Reference You're probably looking for this: http://www.digitalmars.com/d/2.0/mixin.html

Re: Some help on Mixin Template at Class level.

2011-05-22 Thread Simen Kjaeraas
On Sat, 21 May 2011 11:40:22 +0200, Matthew Ong on...@yahoo.com wrote: Using your code I have this error: src\Sample.d(16): Error: undefined identifier btype, did you mean template AType(string name,U,alias V)? src\Sample.d(16): Error: mixin AType!(ClassB,string,_error_) does not match

Some help on Mixin Template at Class level.

2011-05-21 Thread Matthew Ong
Hi, As the documentation at D ONLY shows template at functions level and also ONLY the content of a class but without the definition of a class. Could this code be working? Or did I miss out some syntax. mixin template AType(alias T, U, alias V){ class T : ClassC { // Class level Template

Re: Some help on Mixin Template at Class level.

2011-05-21 Thread Simen Kjaeraas
On Sat, 21 May 2011 10:54:54 +0200, Matthew Ong on...@yahoo.com wrote: mixin template AType(alias T, U, alias V){ class T : ClassC { // Class level Template This gives you a class called T. You seem to want it to have the name you pass as a string, in which case you have to use string mixins.

Re: Some help on Mixin Template at Class level.

2011-05-21 Thread Matthew Ong
On 5/21/2011 5:12 PM, Simen Kjaeraas wrote: On Sat, 21 May 2011 10:54:54 +0200, Matthew Ong on...@yahoo.com wrote: mixin template AType(alias T, U, alias V){ class T : ClassC { // Class level Template This gives you a class called T. You seem to want it to have the name you pass as a string,