title: 'to_string' unknown override specifier
body: <p>For an assignment I am supposed to use the following class in a header file <code>'date.h'</code> However when I attempted to compile my program I got an error stating:</p>
  
  <blockquote>
    <p>'to_string': unknown override specifier.</p>
  </blockquote>
  
  <p>What is wrong with the following code? I can't seem to figure it out.     </p>
  
  <pre><code>#pragma once
  #ifndef DATE_H
  #define DATE_H
  
  #include &lt;string&gt;
  #include &lt;sstream&gt;
  
  class Date
  {
  private:
      int m_day, m_month, m_year;
  public:
      Date(int d, int m, int y)
      {    
          m_day = d; m_month = m; m_year = y;
      }
  
      int getDay() const { return m_day; }
      int getMonth() const { return m_month; }
      int getYear() const { return m_year; }
      string to_string() const
      {
          stringstream s;
          s &lt;&lt; getMonth() &lt;&lt; "/" &lt;&lt; getDay() &lt;&lt; "/" &lt;&lt; getYear();
          return s.str();
      }
  };
  #endif
  </code></pre>