Test for self referential templated Class

Manfred Nowak svv1999 at hotmail.com
Sun Jun 29 20:48:54 PDT 2008


Seems, that tests for the type of a self referential templated class 
are impossible, because recursive expansion is forbidden.

Am I missing something?

Example:

import std.metastrings;
class C(T){
  pragma( msg, Format!(is(T:C!(int))));
  //pragma( msg, Format!(is(T:C!(C!(int)))));  //recursive expansion 
forbidden
}
void main(){
  auto c1= new C!( C!(int));
  auto c2= new C!( C!( C!(int)));
}

-manfred



More information about the Digitalmars-d mailing list