June 28, 2008 Template Instantiation | ||||
---|---|---|---|---|
| ||||
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 |
Copyright © 1999-2021 by the D Language Foundation