No, there is currently no way of not getting it inside the generated sources (maybe in the next version). However, you can always avoid importing the parser's namespace in the rest of the project by using this technique (hopefully i remember this well, i think you can find it in Stroustrup's anyway):
namespace polluted {
// hide all this stuff from the rest of your code...
#include "my_parser.hh"
using namespace cppcc;
}
// ... then explicitely bring in what you need.
using polluted::MyParser;
Alec.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I noticed that all generated files have
using namespace std;
at the very beginning. That sentence will pollute the program's namespace. Any way to not generate that sentence in the header file?
No, there is currently no way of not getting it inside the generated sources (maybe in the next version). However, you can always avoid importing the parser's namespace in the rest of the project by using this technique (hopefully i remember this well, i think you can find it in Stroustrup's anyway):
namespace polluted {
// hide all this stuff from the rest of your code...
#include "my_parser.hh"
using namespace cppcc;
}
// ... then explicitely bring in what you need.
using polluted::MyParser;
Alec.