Ok I found "the" answer myself. I guess that I was not aware that the using declaration in a namespace is still valid in below namespace scopes with the same name. Now Bjarne's words also makes more sense, that one should not pollute the global namespace :). Please correct me though, if I'm still doing something wrong.
SharedPtr.h:
#ifndef SHAREDPTR_H_
#define SHAREDPTR_H_
#ifdef HAS_SHAREDPOINTER
#include <memory>
namespace blub {
using std::shared_ptr;
}
#else
#include <tr1/memory>
namespace blub {
using std::tr1::shared_ptr;
}
#endif
#endif /* SHAREDPTR_H_ */
ModelPar.h:
#ifndef MODELPAR_H_
#define MODELPAR_H_
#include <string>
#include <set>
#include "SharedPtr.h"
namespace blub {
class ModelPar {
private:
std::set<shared_ptr<ModelPar> > connections;
...
};
}
#endif /* MODELPAR_H_ */