title: template parameter name as base class
body: <p>I've the following types:</p>
  
  <pre><code>typedef unsigned int uint32;
  
  typedef void* ptr;
  
  struct memory_options {};
  
  struct memory_provider {};
  
  template &lt;typename options&gt;
  struct memory_track {};
  
  template &lt;typename options&gt;
  struct no_memory_track : public memory_track&lt;options&gt; {};
  
  template&lt;typename options&gt;
  struct defrag_memory_track : public memory_track&lt;options&gt; {};
  
  template&lt;typename options&gt;
  struct full_memory_track : public memory_track&lt;options&gt; {};
  
  template &lt;typename options, typename prov, typename track&gt;
  struct memory_algorithm : public track &lt; options &gt; {};
  
  int main()
  {
  }
  </code></pre>
  
  <p>This types used to define a custom memory manager.</p>
  
  <p>The problem is the class <code>memory_algorithm</code> will inherit from another class, that class will always take a <code>template parameter</code> that represent <code>memory_options</code> class, i call it <code>options</code>. The base class may be a partial specialization from <code>memory_track</code> or a subclass from it, so in <code>memory_algorithm</code> i passed 2 template parameters one represents the class name - i.e. <code>track</code> - and the other represent the <code>memory_options</code> class - i.e. <code>options</code> - now whenever i tried to compile the code with sample test unit using GCC and Visual C++ 2008 i got the error:</p>
  
  <p>for visual c++:</p>
  
  <blockquote>
    <p>missing ',' before '&lt;'</p>
    
    <p>see reference to class template instantiation 'memory_algorithm' being compiled</p>
  </blockquote>
  
  <p>for GCC:</p>
  
  <blockquote>
    <p>error: expected template-name before '&lt;' token</p>
    
    <p>error: expected '{' before '&lt;' token</p>
    
    <p>error: expected unqualified-id before '&lt;' token</p>
  </blockquote>
  
  <p>What is the problem and how to fix it?</p>