Back in the days of C, there were two solutions to the problem of naming functions:
1. Just name it what you think it should be called and pray that no one else has made a different function with the same name.
2. Follow the convention <project>_<function>.
#1 could create conflicts between unrelated libraries that just happened to have functions named the same, and #2 is a bit ugly.
Namespaces are more elegant solution.
using namespace
in a very broad scope sends you right back to the days of C. You better not make any functions named max, or find, or sort. Two safer alternatives are:
1. Just use what you will use the most. E.g.
using boost::filesystem::path;
2. Restrict the using to a more limited scope. E.g.
1 2 3 4 5 6 7 8
|
void foo(){
using namespace std;
cout << "This works.\n";
}
void bar(){
cout << "This doesn't.\n";
}
|
Personally, I don't find typing "std::" every time that big a deal. Some Boost namespaces can get rather cumbersome, though.