1
0

remove string type ambiguity in header

I ran into a compilation issue.

This link explains the problem well: https://stackoverflow.com/a/5499222/3736700

For example, in a header file, it is generally not considered a good idea to put the line using namespace std; (or to use any namespace, for that matter) because it can cause names in files that include that header to become ambiguous. In this setup, you would just #include <string> in the header, then use std::string to refer to the string type.
This commit is contained in:
Edmond Cote 2018-01-13 13:29:22 -08:00 committed by GitHub
parent 8799508b1f
commit ff11673a9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ class VerilatedVcdFILE : public VerilatedVcdFile {
public: public:
VerilatedVcdFILE(FILE* file) : file(file) {} VerilatedVcdFILE(FILE* file) : file(file) {}
~VerilatedVcdFILE() {} ~VerilatedVcdFILE() {}
bool open(const string& name) override { bool open(const std::string& name) override {
// file should already be open // file should already be open
return file != NULL; return file != NULL;
} }