Template Instantiation
Manfred Nowak
svv1999 at hotmail.com
Sat Jun 28 05:38:50 PDT 2008
How is the sequence of instantiations determined in case of entwined
definitions of templates?
Example:
template Mapping( uint n, Value){
static if( n == 0){
pragma( msg, "map n==0");
alias E!( Value, DATA) Mapping;
} else {
pragma( msg, "map n>0");
alias E!( Mapping!( n -1, Value), MGR) Mapping;
}
}
In which sequence will the instantiation
alias Mapping!(3, int) Map;
auto v= new Map;
cause the template E to be instantiated?
I ask this because on slight modifications I got errors, that E wasn't
instantiated.
-manfred
More information about the Digitalmars-d-learn
mailing list