We can cancel #def by #undef.
Can I cancel “using” or “using namespace” in the similar way?
We can cancel #def by #undef. Can I cancel using or using namespace in
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, you can’t.
Your best solution is not to have
usingdirectives in header files, and minimize (and even remove them completely) their use from source files.If you’re having troubles with namespaces, you can use
::to go to the globalnamespace, but the cleanest way is clearing the directives.EDIT: This applies to C++.