Just as advice, please don’t declare namespaces using the “using namespace <namespace_name>”. Unless you know what functions are implemented inside of it, if two namespaces have the same function name in both of them with different implementations, the compiler will run the function based on the namespace you have declared using the “using namespace <namespace_name>.”
It is better, for example, instead of instatiating the namespace “using namespace std” you should do std::cout << “your_string” << std::endl this is explicitly saying from the std namespace, get cout, and from std namespace, get endl. It is more clear it is concise and everyone knows where you are getting this function from. Whereas if you did “using namespace std” and then cout << “your_string” << endl no one knows where you are getting those functions.
Explicitly instantiate your namespaces at the time you declare your functions inside said namespaces even if it means tediously writing out the namespace every instantiation, it makes reading your c++ code that much more easier.
Just as advice, please don’t declare namespaces using the “using namespace <namespace_name>”. Unless you know what functions are implemented inside of it, if two namespaces have the same function name in both of them with different implementations, the compiler will run the function based on the namespace you have declared using the “using namespace <namespace_name>.”
It is better, for example, instead of instatiating the namespace “using namespace std” you should do std::cout << “your_string” << std::endl this is explicitly saying from the std namespace, get cout, and from std namespace, get endl. It is more clear it is concise and everyone knows where you are getting this function from. Whereas if you did “using namespace std” and then cout << “your_string” << endl no one knows where you are getting those functions.
Explicitly instantiate your namespaces at the time you declare your functions inside said namespaces even if it means tediously writing out the namespace every instantiation, it makes reading your c++ code that much more easier.