Possible duplicate:
Why is' namespace std; considered bad practice in C ++?
I used stl shared_ptr many places in my code, and I used the following using statement somewhere that used shared_ptr :
using namespace std::tr1;
Now I need to use boost::bimap . Therefore, I must include the following header file in my code:
#include <boost/bimap.hpp>
As soon as I include the bimap header file, the shared_ptr type becomes ambiguous, and I have to change all uses of shared_ptr to std::tr1::shared_ptr . Since this makes my code ugly, I am looking for a way to avoid this ambiguity by not requiring a shared_ptr declaration everywhere with a full name. I thought to use typedef for std::tr1::shared_ptr , but maybe there are better ways. Any advice would be appreciated!
source share