title: Passing a template to deque
body: <p>I'm trying to write a container class for deque to make a circular buffer (using deque is important here since the class is replacing a vector and does need to be used like one here). I don't want to have to make the container class specific to a specific deque; that is, I want the class to be a template class and the deque to get the templated type. However, my code gives me use of undefined type errors when it compiles (c:\program files (x86)\microsoft visual studio 10.0\vc\include\deque(795): error C2027: use of undefined type 'dequeClass').</p>
  
  <p>The code: </p>
  
  <pre><code>#pragma once
  
  #include &lt;deque&gt;
  
  template&lt;typename dequeClass&gt;
  class CircularDeque {
  public:
      CircularDeque(int newMax);
      ~CircularDeque();
      void push_front(dequeClass&amp;&amp; val);
      void push_front(const dequeClass&amp; val);
      void push_back(dequeClass&amp;&amp; val);
      void push_back(const dequeClass&amp; val);
      std::deque&lt;dequeClass&gt; que;
      int getMax();
      void setMax(int newMax);
  private:
      unsigned int max;
  };
  
  CircularDeque&lt;class dequeClass&gt;::CircularDeque(int newMax) {
      max = newMax;
  }
  
  void CircularDeque&lt;class dequeClass&gt;::push_front(dequeClass&amp;&amp; val) {
      que.push_front(val);
      if(que.size() &gt; max) {
          que.pop_back();
      }
  }
  
  void CircularDeque&lt;class dequeClass&gt;::push_front(const dequeClass&amp; val) {
      que.push_front(val);
      if(que.size() &gt; max) {
          que.pop_back();
      }
  }
  
  void CircularDeque&lt;class dequeClass&gt;::push_back(dequeClass&amp;&amp; val) {
      que.push_back(val);
      if(que.size() &gt; max) {
          que.pop_front();
      }
  }
  
  void CircularDeque&lt;class dequeClass&gt;::push_back(const dequeClass&amp; val) {
      que.push_back(val);
      if(que.size() &gt; max) {
          que.pop_front();
      }
  }
  
  int CircularDeque&lt;class dequeClass&gt;::getMax() {
      return max;
  }
  
  void CircularDeque&lt;class dequeClass&gt;::setMax(int newMax) {
      max = newMax;
  }
  </code></pre>
  
  <p>Anyone know what I can do here?</p>