title: syntax error: missing ',' before '<'
body: <p>I just started coding in c++ after a long while, and perhaps I am missing something syntactically obvious here, but I have searched for good long while now and can't find a reference to my problem anywhere. I am trying to create a custom C++ class for <code>set</code> and <code>multiset</code>.</p>
  
  <p>Here is my class <strong>cset.h</strong></p>
  
  <pre><code>#pragma once
  #include &lt;set&gt;
  #include "cmultiset.h"
  
  template &lt;class Type&gt;
  
  class Set : public set&lt;Type&gt;
  {
  private:
  
  public:
      void add(Type &amp;);
  };
  </code></pre>
  
  <p>And here is my <strong>cmultiset.h</strong></p>
  
  <pre><code>#pragma once
  #include &lt;set&gt;
  
  template &lt;class Type&gt;
  
  class MultiSet : public multiset&lt;Type&gt;
  {
  private:
  
  public:
      bool operator &lt; (MultiSet &lt;Type&gt; &amp;);
  };
  </code></pre>
  
  <p>What I am trying to do here is create a <code>Set&lt;MultiSet&lt;int&gt;&gt;</code> in my driver class. But get the following error twice for each file instead in the above header files at <code>class Set : public set&lt;Type&gt;</code> and <code>class MultiSet : public multiset&lt;Type&gt;</code>.</p>
  
  <pre><code>syntax error: missing ',' before '&lt;'
  </code></pre>
  
  <p>I don't know how to resolve this error.</p>
  
  <p>If I use just <code>set&lt;MultiSet&lt;int&gt;&gt;</code> everything works fine: No Errors no warnings (I do have to add <code>using namespace std;</code> before the template). However when I use <code>Set&lt;MultiSet&lt;int&gt;&gt;</code> it gives the error and <code>using namespace std</code> doesn't work.</p>
  
  <p><strong>Edit 1 :</strong></p>
  
  <p><strong>Errors :</strong></p>
  
  <pre><code>Severity    Code    Description Project File    Line    Suppression State
  Error   C2143   syntax error: missing ',' before '&lt;'    Integer Sets Analyzer   c:\users\abbas\documents\mega\personal projects\integer sets analyzer\integer sets analyzer\cmultiset.h 6   
  Error   C2143   syntax error: missing ',' before '&lt;'    Integer Sets Analyzer   c:\users\abbas\documents\mega\personal projects\integer sets analyzer\integer sets analyzer\cmultiset.h 6   
  Error   C2143   syntax error: missing ',' before '&lt;'    Integer Sets Analyzer   c:\users\abbas\documents\mega\personal projects\integer sets analyzer\integer sets analyzer\cset.h  7   
  Error   C2143   syntax error: missing ',' before '&lt;'    Integer Sets Analyzer   c:\users\abbas\documents\mega\personal projects\integer sets analyzer\integer sets analyzer\cmultiset.h 6   
  Error   C2143   syntax error: missing ',' before '&lt;'    Integer Sets Analyzer   c:\users\abbas\documents\mega\personal projects\integer sets analyzer\integer sets analyzer\cset.h  7   
  </code></pre>
  
  <p><strong>Edit 2 :</strong></p>
  
  <p>Here is my <strong>main.cpp</strong></p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &lt;conio.h&gt;
  #include "cmultiset.h"
  #include "cset.h"
  
  using namespace std;
  
  int main()
  {
      Set&lt;MultiSet &lt;int&gt;&gt; intSet;
  
      intSet.clear();
  
      _getch();
  
      return 0;
  }
  </code></pre>
  
  <p>Here is my <strong>MultiSet.cpp</strong></p>
  
  <pre><code>#pragma once
  #include "stdafx.h"
  #include "cmultiset.h"
  
  using namespace std;
  
  template &lt;class Type&gt;
  bool MultiSet&lt;Type&gt;::operator &lt; (MultiSet&lt;Type&gt; &amp; cmpSet)
  {
      if (this-&gt;size() &lt; cmpSet.size())
      {
          return true;
      }
      else if (this-&gt;size() &gt; cmpSet.size())
      {
          return false;
      }
  
      for (multiset&lt;Type&gt;::iterator it = this-&gt;begin(), jt = cmpSet.begin(); it != this-&gt;end(), jt != cmpSet.end(); ++it, ++jt)
      {
          if (*it &lt; *jt)
              return true;
      }
  
      return false;
  }
  </code></pre>
  
  <p>Here is my <strong>Set.cpp</strong>.</p>
  
  <pre><code>#pragma once
  #include "stdafx.h"
  #include "cset.h"
  
  using namespace std;
  
  template &lt;class Type&gt;
  void Set&lt;Type&gt; :: add(Type &amp; entry)
  {
      set&lt;Type&gt;::insert(entry);
  }
  </code></pre>