Consider the following small piece of code:
#include "myheader1.h"
#include "myheader2.h"
#include <string>
void foo() {
string s("hello world");
}
This compiles, so obviously some of the recursively included header files have
using namespace std;
somewhere. How would you know where this offensive line of code is?
Just using grepheader files for all files will not work, because this statement is often used inside a function where it is safe and will not pollute the rest of the code.
Frank source
share