title: Abs and using namespace std
body: <p>Say I am using <code>using namespace std</code> (undeniably <a href="https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice">bad practice</a>) and that I use the <code>abs</code> function in my code (to get <a href="https://stackoverflow.com/questions/3118165/when-do-i-use-fabs-and-when-is-it-sufficient-to-use-stdabs">the overloaded absolute function</a>). To be specific my MWE is:</p>
  
  <pre><code>#include &lt;cmath&gt;
  #include &lt;iostream&gt;
  #include &lt;stdlib.h&gt;
  
  using namespace std; 
  
  int main(int argc, char* argv[]) {
  
   double f(-0.4);
   std::cout&lt;&lt;"abs(f) = "&lt;&lt;abs(f)&lt;&lt;std::endl;
  
  }
  </code></pre>
  
  <p>If I comment out the <code>using namespace std;</code> line then the output is</p>
  
  <pre><code>abs(f) = 0
  </code></pre>
  
  <p>else the output is </p>
  
  <pre><code>abs(f) = 0.4
  </code></pre>
  
  <p>What I don't understand is how the "correct" abs function is invoked in the latter case given that even stdlib.h has an <code>abs</code> function that returns only <code>int</code>'s. </p>
  
  <p>In fact the second answer to <a href="https://stackoverflow.com/questions/3118165/when-do-i-use-fabs-and-when-is-it-sufficient-to-use-stdabs">this question</a> says that using <code>using namespace std;</code> may <strong>not be enough</strong>. Is this true? My MWE seems to contradict this. </p>
  
  <p>I am on Linux and using gcc-4.8, which is arguably the most problematic combination to resolve dependencies.</p>