
5 Nov
2008
5 Nov
'08
3:21 p.m.
Hi, "using" the whole namespace is not healthy, because you "dirty" the global namespace and raise the probability of conflicts. Instead, you could "import" some specific classes: using boost::shared_ptr; Then, if you decide to use the tr1 one, you just change it to: using std::tr1::shared_ptr;
For example in .cpp files I using several usings such as:
using namespace std; using namespace std::tr1; using namespace boost;
In source code I have something like this:
shared_ptr<SomeType> var = /*...*/;
And for each such line I have an error: error C2872: 'shared_ptr' : ambiguous symbol