I’m not an c++ expert, but I do coding since 1999 (as my profession). So I try to answer, what I learned about it.
C++ uses namespaces to avoid name clashes. It can be compared to Java and the packages in there. That’s good, because so you can write a function bestFunctionEver (in namespace foo) and I can create a library with bestFunctionEver (in namespace bar). You can use both in you code, with just writing foo::bestFunctionEver or bar::bestFunctionEver.
The command using namespace std will remove the namespace for the std. Consider you are writing your code in foo and have a string class. Because you are within your own namespace, you can call string. It’s fine. Now you set using namespace std. The compiler didn’t know which string class do you want, so you have to write foo::string or std::string.
Your code will compile as normal, but in my opinion it’s better to avoid using namespace for external libraries and to prefix the calls.