title: Why const correctness rule doesn't work for built in libraries?
body: <p>There is a rule about const methods. If the method is const, and we are trying to use another function at the same method, so it should be const as well. Otherwise, we will have a compilation error. I was trying to find the declaration of abs() function in math.h library, and here is what I found: <a href="http://www.cplusplus.com/reference/cstdlib/abs/" rel="nofollow noreferrer">Declarations of abs()</a>
  It means that the abs() function is not const, but when I use it inside const method I am not having a compilation error. can somebody explain why is that?</p>
  
  <pre><code>class D:public B,C
  {
  public:
      D()
      {
          cout&lt;&lt;"This is constuctor D"&lt;&lt;endl;
      }
  
      int fun3() const;
  
      ~D()
      {
           cout&lt;&lt; "Destructor D"&lt;&lt;endl;
      }
  };
  
  int D::fun3() const
  {
      int x=-3;
  
      return abs(x);
  }
  </code></pre>