title: Call template function from within a template class
body: <p>GCC will not compile following code snippet (which in fact is correct behavior of GCC as it is conform to the standard C++ as I have learned already. VC++ however will compile.)</p>
  
  <pre><code>template&lt;class T&gt;
  void CUDAMemory1D2DTextureAllocator&lt;T&gt;::allocateMemoryOnDevice()
  {
      m_pChannelDesc = cudaCreateChannelDesc&lt;T&gt;();
      ...
  }
  </code></pre>
  
  <p>As i already found out by searching is, that one needs to tell the compiler that <code>cudaCreateChannelDesc</code> is a template method. Otherwise it will try to
  parse <code>&lt;</code> as a smaller than operator...</p>
  
  <p>The following snippet shows that in an easy example:</p>
  
  <pre><code>template&lt; typename G &gt;
  struct Test
  {
      template&lt; typename T &gt; T f() const;
  };
  
  template&lt; typename G, typename T &gt;
  void g()
  {
      Test&lt; G &gt; t;
  
      t.f&lt; T &gt;();           // ERROR: gcc won't compile that
      t.template f&lt; T &gt;();  // OK: now gcc knows that f is a template method an treads the following angle brackets  not as operators but as template brackets...
  } 
  </code></pre>
  
  <p>So far so good. Now my question is, how to do that in the above case, where the method I call is <code>cudaCreateChannelDesc</code> which does not belong to any class or namespace?
  Any advice or suggestion how to solve this situation are very welcome.</p>
  
  <p>Thanks</p>