title: C++ - compilation error
body: <p>I am implementing a vector, and for some reason, my header file keeps saying this error:</p>
  
  <pre><code>error C2590: 'CopyValues' : only a constructor can have a base/member initializer list
               see reference to class template instantiation 'Vector&lt;T&gt;' being compiled
  error C2533: 'Vector&lt;T&gt;' : constructors not allowed a return type
  error C2760: syntax error : expected '{' not ';'
  error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
  error C2039: 'GetNewCapacity' : is not a member of 'Vector&lt;T&gt;'
  </code></pre>
  
  <p>Here's my header:</p>
  
  <pre><code>template &lt;class T&gt;
  class Vector
  {
  public:
      typedef T* Iterator; 
  
      Vector(HeapAllocator* allocator);
      Vector(HeapAllocator* allocator, size_t size);
      ~Vector();
  
      size_t capacity();
      size_t size();
      bool empty();
      void clear();
  
      Iterator insert(Iterator position, const T&amp; value);
      void insert(Iterator position,size_t n, const T&amp; value);
      void insert(Iterator position,Iterator first, Iterator last);
  
      void erase();
  
      void resize(size_t numElements);
  
      void push_back(const T&amp; item);
      void pop_back();
  
  private:
      void CopyValues(Iterator pBegin, Iterator pEnd, Iterator pTarget):      // when I comment out this method, it compiles fine, why?
      size_t GetNewCapacity(size_t currentCapacity);
  
      T* mBegin;
      T* mEnd;
      T* mCapacity;
      HeapAllocator* mAllocator;
  
  };
  </code></pre>
  
  <p>Im staring blindly at the code, but I can't find any syntax error. What is causing this?</p>