diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-24T21·29+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-24T21·29+0100 |
commit | 838f86b0fd880b26539664140f04e5d16669dad8 (patch) | |
tree | c8fee2f0c136fbe5bb0735604e2f04d5b02698ba /third_party/nix/src/libutil/types.hh | |
parent | f30b2e610d9e612504a9f6460e0cc83413b80aeb (diff) |
style(3p/nix): Remove 'using std::*' from types.hh r/840
It is considered bad form to use things from includes in headers, as these directives propagate to everywhere else and can make it confusing. types.hh (which is includes almost literally everywhere) had some of these directives, which this commit removes.
Diffstat (limited to 'third_party/nix/src/libutil/types.hh')
-rw-r--r-- | third_party/nix/src/libutil/types.hh | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/third_party/nix/src/libutil/types.hh b/third_party/nix/src/libutil/types.hh index ac1b802ce0f1..ad44719afe3a 100644 --- a/third_party/nix/src/libutil/types.hh +++ b/third_party/nix/src/libutil/types.hh @@ -22,10 +22,6 @@ namespace nix { /* Inherit some names from other namespaces for convenience. */ using boost::format; -using std::list; -using std::set; -using std::string; -using std::vector; /* A variadic template that does nothing. Useful to call a function for all variadic arguments but ignoring the result. */ @@ -35,8 +31,8 @@ struct nop { }; struct FormatOrString { - string s; - FormatOrString(const string& s) : s(s){}; + std::string s; + FormatOrString(const std::string& s) : s(s){}; FormatOrString(const format& f) : s(f.str()){}; FormatOrString(const char* s) : s(s){}; }; @@ -64,8 +60,8 @@ inline std::string fmt(const std::string& fs, Args... args) { a subclass. Catch Error instead. */ class BaseError : public std::exception { protected: - string prefix_; // used for location traces etc. - string err; + std::string prefix_; // used for location traces etc. + std::string err; public: unsigned int status = 1; // exit status @@ -84,8 +80,8 @@ class BaseError : public std::exception { const char* what() const noexcept { return err.c_str(); } #endif - const string& msg() const { return err; } - const string& prefix() const { return prefix_; } + const std::string& msg() const { return err; } + const std::string& prefix() const { return prefix_; } BaseError& addPrefix(const FormatOrString& fs); }; @@ -108,13 +104,13 @@ MakeError(Error, BaseError) std::string addErrno(const std::string& s); }; -typedef list<string> Strings; -typedef set<string> StringSet; +typedef std::list<std::string> Strings; +typedef std::set<std::string> StringSet; typedef std::map<std::string, std::string> StringMap; /* Paths are just strings. */ -typedef string Path; -typedef list<Path> Paths; -typedef set<Path> PathSet; +typedef std::string Path; +typedef std::list<Path> Paths; +typedef std::set<Path> PathSet; } // namespace nix |