From ff11673a9c3f1017ab1b3ba410414f04836a6af4 Mon Sep 17 00:00:00 2001 From: Edmond Cote Date: Sat, 13 Jan 2018 13:29:22 -0800 Subject: [PATCH] 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 in the header, then use std::string to refer to the string type. --- csrc/verilator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csrc/verilator.h b/csrc/verilator.h index b4cd0659..d5ada6c0 100644 --- a/csrc/verilator.h +++ b/csrc/verilator.h @@ -12,7 +12,7 @@ class VerilatedVcdFILE : public VerilatedVcdFile { public: VerilatedVcdFILE(FILE* file) : file(file) {} ~VerilatedVcdFILE() {} - bool open(const string& name) override { + bool open(const std::string& name) override { // file should already be open return file != NULL; }