Removing using namespace std causes the program to get crap results
I have a complicated least-squares fitting program, which I was recently
debugging. I was debugging stuff by cout-ing them to the console, and to
make it easier, I used
using namespace std;
and funnily, after weeks of coding, I wanted to remove this because
debugging is done, and the surprise was that removing it causes the result
to be wrong! I did a complete abstract check in g++ and icpc (intel
compiler) where I remove and restore this directive, and when it's
removed, the result it wrong...
I know it's a very broad question and not easy to hit the answer, but what
would you do in this case? How would you debug such a dependence?
No comments:
Post a Comment