== Quote from bearophile (bearophileh...@lycos.com)'s article Thanks for all the suggestions!
A little more discussion: > > So I need some slick way of mapping the run-time element size, row count, > > and column count into a static array type to instantiate my template with. > A basic brutal way to do that is to use a switch, that switches according to > the runtime value to use the correctly compile-time instantiated template. If the switch becomes too much large you can use a string mixin to shrink it to few lines. I had thought of the switch, and it would be too large. Can you give me an idea of what the mixin solution would look like? Suppose I have three strings, type, rows, and cols that get set at runtime, where type = ["int" | "float" | "short"], rows and cols = ["100" | "200" | "250"]. What I want is to take these 3 variables and come up with: foo!(int[100][100])(...) foo!(int[100][200])(...) ... foo!(short[250][250])(...) for the right cases, without switching on type, rows, or cols. Thanks again. Jason