title: could not deduce template argument for 'T'
body: <p>My code is :</p>
  
  <pre><code>std::vector&lt;double&gt; Vec;
  
  template&lt;typename T&gt;
  void GetObj(VARIANT &amp;vtProp) 
  {
      CComSafeArray&lt;T&gt; SafeArray;
  
      SafeArray.Attach(vtProp.parray);
      ULONG Count = SafeArray.GetCount();
      Vec.resize(Count);
      for(ULONG Index = 0; Index &lt; Count; Index++)
      {
          Vec[Index] = SafeArray[Index];
      }
  }
  </code></pre>
  
  <p>while compilation I got the error below:</p>
  
  <pre><code>error C2783: 'void __cdecl GetObj(struct tagVARIANT &amp;)' : could not deduce template argument for 'T'
  </code></pre>
  
  <p>Kindly suggest me the correct answer</p>