title: Why is my std::string getting converted to std::basic_string<char>?
body: <blockquote>
    <p><strong>Error</strong></p>
  </blockquote>
  
  <pre><code>stack.cc:53:28: error: no matching function for call to ‘Stack&lt;std::basic_string&lt;char&gt; &gt;::push(std::string)’
  stack.cc:53:28: note: candidate is:
  stack.cc:32:11: note: Stack&lt;T&gt;&amp; Stack&lt;T&gt;::push(T&amp;) [with T = std::basic_string&lt;char&gt;]
  </code></pre>
  
  <blockquote>
    <p><strong>stack.cc</strong></p>
  </blockquote>
  
  <pre><code>#include&lt;iostream&gt;
  
  template &lt;typename T&gt;
  class Stack {
  private:
      T* array_;
      int length_;
      T* last_;
      void expandArray();
  
  public:
      Stack(int length = 8) {
          array_   = new T[length];
          length_  = length;
          last_    = array_;
      }
  
      Stack&lt;T&gt;&amp; push(T&amp;);
      T pop();
  };
  
  template&lt;typename T&gt;
  void Stack&lt;T&gt;::expandArray() {
      T* array_temp = new T[length_ &lt;&lt; 1];
      memcpy(array_temp, array_, length_);
      std::swap(array_, array_temp);
      delete[] array_temp;
      length_ &lt;&lt;= 1;
  }
  
  template&lt;typename T&gt;
  Stack&lt;T&gt;&amp; Stack&lt;T&gt;::push(T&amp; data) {
      if (last_ == (array_ + length_ - 1)) {
          expandArray();
      }
      last_[0] = data;
      last_++;
      return *this;
  }
  
  template&lt;typename T&gt;
  T Stack&lt;T&gt;::pop() {
      if(array_ != last_) {
          T temp = last_[0];
          last_--;
          return temp;
      }
      return NULL;
  }
  
  int main() {
      Stack&lt;std::string&gt; s;
      s.push(std::string("a"))
       .push(std::string("b"))
       .push(std::string("c"))
       .push(std::string("d"));
      std::cout &lt;&lt; s.pop() &lt;&lt; std::endl;
      std::cout &lt;&lt; s.pop() &lt;&lt; std::endl;
      std::cout &lt;&lt; s.pop() &lt;&lt; std::endl;
      std::cout &lt;&lt; s.pop() &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>Wanted to understand why a conversion is happening from <code>std::string</code> to <code>std::basic_string&lt;char&gt;</code>?</p>
  
  <p>Please feel free to comment on the code quality as well.</p>