Can I undo a command using
?
Example code of what I was thinking:
#include <iostream>
using namespace std;
namespace one {
void write() {
cout << "write:one" << endl;
}
}
namespace two {
void write() {
cout << "write:two" << endl;
}
}
void write() {
cout << "write:write" << endl;
}
int main() {
one::write();
two::write();
using one::write;
write(); //And it's called from namespace one witch is correct
//but now i want to call a global method and how i can do that.
return 0;
}
I want to switch from calling one to global. Can I do this? If so, how?
You cannot undo a using
directive. But you can use a name from the global namespace with ::
. For example,
::write();