digitalmars.D.learn - Instantiation of forward referenced class from template mixin
- Jan (13/13) Jan 13 2008 Why does the code below generate the linking error undefined reference t...
- Jarrett Billingsley (9/23) Jan 13 2008 To be honest I have _no_ idea what you're trying to do here. I'm actual...
Why does the code below generate the linking error undefined reference to <class> template ok(T) { class T { } } class test; mixin ok!(test); void main() { test t = new test(); }
Jan 13 2008
"Jan" <danijans03 student.kau.se> wrote in message news:fmcsgc$ub7$1 digitalmars.com...Why does the code below generate the linking error undefined reference to <class> template ok(T) { class T { } } class test; mixin ok!(test); void main() { test t = new test(); }To be honest I have _no_ idea what you're trying to do here. I'm actually kind of surprised that the compiler allows this code to be compiled. Are you trying to use mixins as some sort of substitute for C macros? In either case, what's with the "class test;"? You don't need function or class prototypes. Why don't you explain what you're trying to do, and we'll try to come up with a solution?
Jan 13 2008