title: how do I create a functioning vector<wchar_t> that has an erase(size_t pos) method?
body: <p>I am creating a C++ <code>wstring</code> class for use with mingw version 4.3.0, cross-compiling for Win32. I want my string to work like <code>std::string</code> which means that I want an <code>erase(int pos)</code> method that erases a single element at position <code>pos</code>.</p>
  
  <p>Here is my first attempt:</p>
  
  <pre><code>#include &lt;wchar.h&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  class wstring : public std::vector&lt;wchar_t&gt;{
  public:
      void erase(size_t where){
      erase(begin()+where);
      }
  };
  
  int main(int argc,char **argv) {
      wstring c1;
      c1.push_back(L'a');
      c1.push_back(L'b');
      c1.push_back(L'c');
      c1.erase(1);
  
      for(size_t i = 0;i&lt;c1.size();i++){
      std::cout &lt;&lt; "c1[" &lt;&lt; i &lt;&lt; "] = " &lt;&lt; c1[i] &lt;&lt; "\n";
      }
      return 0;
  }
  </code></pre>
  
  <p>This looks like it should work to me, but I get this wacko compiler error when I try to compile it:</p>
  
  <pre><code>$ i386-mingw32-g++ x1.cpp
  x1.cpp: In member function 'void wstring::erase(size_t)':
  x1.cpp:8: error: no matching function for call to 'wstring::erase(__gnu_cxx::__normal_iterator&lt;wchar_t*, std::vector&lt;wchar_t, std::allocator&lt;wchar_t&gt; &gt; &gt;)'
  x1.cpp:7: note: candidates are: void wstring::erase(size_t)
  $ 
  </code></pre>
  
  <p>What's really weird is that if I take out the <code>erase</code> method and just inline the code, I have no problem:</p>
  
  <pre><code>#include &lt;wchar.h&gt;
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  class wstring : public std::vector&lt;wchar_t&gt;{
  };
  
  int main(int argc,char **argv) {
      wstring c1;
      c1.push_back(L'a');
      c1.push_back(L'b');
      c1.push_back(L'c');
      c1.erase(c1.begin()+1);
  
      for(size_t i = 0;i&lt;c1.size();i++){
      std::cout &lt;&lt; "c1[" &lt;&lt; i &lt;&lt; "] = " &lt;&lt; c1[i] &lt;&lt; "\n";
      }
      return 0;
  }
  </code></pre>
  
  <p>I'm mystified. </p>