Mapping enum value with templated function
<p>Lets say I have 10 templated functions, for example:</p>

<pre><code>command1&lt;T&gt;(const std::string&amp;) 
command10&lt;T&gt;(const std::string&amp;, int timeInSeconds)
</code></pre>

<p>At a point in time in my code I will establish that I wish to execute a particular command. I will then request information regarding the type associated with this command (at runtime), which is returned to me via an enum. So I establish that I wish to execute <code>command2</code> and the enum contains <code>STRING</code>. I therefore wish to call:</p>

<pre><code>command2&lt;std::string&gt;(id, param1, param2); 
</code></pre>

<p>What would you recommend as a good approach for doing this mapping?</p>

<p>The enum can contain INT, BOOL; DOUBLE or STRING. The arguments passed to a particular command are not dependant on the enum's value.</p>

<p><strong>Example:</strong></p>

<p>Here's an example to explain a little better:</p>

<p>Lets say my program receives "command4 a" from the command line. I parse this input and establish that I need to call command4. I then lookup the type associated with "a" and in this case get <code>INT</code>. I now need to call <code>command4&lt;int&gt;("a");</code></p>
