title: What does "missing template argument" mean?
body: <p>I'm pretty new to C++ and this site so there are bound to be errors. When I try to compile my code I get errors like <code>error: missing template argument before 'b'</code>. I've been searching the world for answers for hours and it has led me here.</p>
  
  <p>My assignment is to implement a templated class Collection that stores a collection of 
          Objects using an array, along
           with the current size of the collection.</p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include "collection.h"
  
      using namespace std; v
  
      int main(int argc, char* argv[])
      {
         collection b;  //&lt;----error missing template argument before 'b'
          return 0;
      }
  </code></pre>
  
  <hr>
  
  <pre><code>    #ifndef COLLECTION_H
      #define COLLECTION_H
  
      #include &lt;iostream&gt;
  
      template &lt;typename obj&gt;
      class collection
      {
      public:
          collection();
          bool isEmpty() const;
          void makeEmpty();
          void insert(obj val);
          void remove(obj val);
          bool contains(obj val) const;
      private:
          size_t size;
          obj* col[];
      };
  
      #endif
  </code></pre>
  
  <hr>
  
  <pre><code>    #include "collection.h"
  
      template &lt;typename obj&gt;
      collection&lt;obj&gt;::collection() :size(10)
      {
          col = new obj*[size];
      }
  
      template &lt;typename obj&gt;
      bool collection&lt;obj&gt;::isEmpty() const
      {
          for(size_t k = 0; k &lt; size; k++)
          {
              if(col[k] != NULL)
                  return false;
          }
          return true;
      }
  
      template &lt;typename obj&gt;
      void collection&lt;obj&gt;::makeEmpty()
      {
          for(size_t k = 0; k &lt; size; k++)
          {
              col[k] = NULL;
          }
      }
  
      template &lt;typename obj&gt;
      void collection&lt;obj&gt;::insert(obj val)
      {
          int temp = 0;
          for(size_t s = 0; s &lt; size; s++)
          {
              if(col[s] != NULL)
                  temp++;
          }
          if(temp &gt;= size)
          {
              obj* temp = new obj*[size*2];
  
              for(size_t c = 0; c &lt; size; c++)
                  temp[c] = col[c];
  
              delete col;
              col = temp;
          }
          else
              col[temp] = val; 
      }
  
      template &lt;typename obj&gt;
      void collection&lt;obj&gt;::remove(obj val)
      {
          for(size_t x = 0; x &lt; size; x++)
          {
              if (col[x] == val)
              {
                  for(size_t y = x; y &lt; size-1; y++)
                  {
                      col[y] = col[y+1];
                  }
                  col[size-1] = NULL;
                  return;
              }
          }
      }
  
      template &lt;typename obj&gt;
      bool collection&lt;obj&gt;::contains(obj val) const
      {
          for(size_t z = 0; z &lt; size; z++)
          {
              if(col[z] == val)
                  return true;
          }
          return false;
      }
  </code></pre>