Explicitly instantiating a class template with a list of paramters
<p>I am trying to instantiate a class template with a whole bunch of different combinations of template parameters which will be decided by some runtime information: <a href="https://github.com/ITKTools/ITKTools/blob/newpixeltypeselector/src/binarythinning/binarythinning.cxx" rel="nofollow">https://github.com/ITKTools/ITKTools/blob/newpixeltypeselector/src/binarythinning/binarythinning.cxx</a> . This system works fine (lines 169 - 190), but it is quite verbose. And this is only 2 and 3 dimensions, what if I wanted 2 - 10? This would be pages of code!</p>

<p>Is there anyway to reduce this to say "instantiate all pairs of [these types] and [these dimensions]" or something like that?</p>

<p>I've seen something like this in Boost, but using Boost is unfortunately not an option for this project.</p>

<p>Any pointers?</p>

<p>Thanks!</p>

<p>David</p>
