title: not " using namespace std; " gives me an unexpected error (C++)
body: <p>This Is my first post here. I have a question about &quot;using namespace std;&quot;. I hope I'm posting this right, but please do tell me If I did something wrong!</p>
  <p>**Problem: ** So the problem that occurs Is that when I remove 'using namespace std;' I get an unexpected error which gives me the following error: <em>&quot;identifier 'to_string' is undefined&quot;.</em> So my question Is, why Is it that I get this unexpected error. (I have marked below with &quot;&lt;-- this part here&quot;) where the error occurs once I remove 'using namespace std;' &quot;. Seems a bit weird to me that I'd have to declare &quot;to_strong&quot; beforehand, but when using namespace std; It somehow declares It for me?</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  // class name {}
  class Person
  {
  private:
      std::string name;
      int age;
  
  public:
      Person()
      {
          std::cout &lt;&lt; &quot;Constructor called!&quot; &lt;&lt; &quot;\n&quot;;
  
          // (this) signals we are trying to access the veriables of private
          this-&gt;name = &quot;N/A&quot;; 
          this-&gt;age = 0;
      }
  
      ~Person() // Destructor is a member function which destructs or deletes an object.
      {
          std::cout &lt;&lt; &quot;Destrouctor called!&quot; &lt;&lt; &quot;\n&quot;;
      }
  
      // Accessors (Getters)
      const std::string&amp; getName() const { return this-&gt;name; }
      const int&amp; getAge() const { return this-&gt;age; }
  
      // Modifiers (Setters)
      void setName(const std::string name) { this-&gt;name = name; }
      void setAge(const int age) { this-&gt;age = age; }
  
      // Functions
      const std::string toString() const
      {
          return &quot;Name: &quot; + this-&gt;name + &quot; Age: &quot; + to_string(this-&gt;age); &lt;-- This part here
      }
  };
  </code></pre>