Distinguish recursive Templates

Manfred Nowak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 22 14:13:50 PDT 2015


How can one determine the recursion depth for templated types?

Example code:

import std.stdio;
class Set(T){
  override string toString(){
    return "Set";
  }
}
void main(){
  auto s0= new Set!uint;
  writeln( s0); // writes Set

  auto s1= new Set!(Set!uint);
  writeln( s1); // should write SetSet
}


More information about the Digitalmars-d-learn mailing list