title: C++ Calling a templated function with a variable type
body: <p>Imagine we have a function (that can not be modified) of this form:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template &lt;typename T&gt;
  Ptr&lt;T&gt; 
  ObjectFactory::Create (void) const
  {
    Ptr&lt;Object&gt; object = Create ();
    return object-&gt;GetObject&lt;T&gt; ();
  }
  </code></pre>
  
  <p>The type of T is used internally for the method <code>GetObject&lt;&gt; ()</code>.</p>
  
  <p>Then I want to have a second function that I don't to template that does something like:</p>
  
  <pre class="lang-cpp prettyprint-override"><code>void install(...)
  {
      Ptr&lt;T&gt; a = Create&lt;T&gt; ():
  }
  </code></pre>
  
  <p>In the code above I used <code>&lt;T&gt;</code>,however I want the T to be a variable and not something that comes from a template. </p>
  
  <p>Is there a way to do that?</p>