I have a template class that uses some boost functions in it's methods. Cause this class is template, it's method should be implemented in a header file. I use some using
declarations to make code more readable:
namespace network {
namespace v1 {
namespace detail {
using boost::phoenix::if_;
using boost::for_each;
/* some more functions */
template <class T>
class Some {
public:
Some() {
for_each(inVector, /* some phoenix code */);
}
private:
vector<int> intVector;
};
}
template <class T> using Some = detail::Some<T>;
}
}
Is it safe to use using
in a header this way? I don't think somebody would ever use using namespace network::v1::detail;
in a .cpp file, so I don't expect functions added to detail namespace would cause any name collisions. Am I wrong?