From 838f86b0fd880b26539664140f04e5d16669dad8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 24 May 2020 22:29:21 +0100 Subject: style(3p/nix): Remove 'using std::*' from types.hh 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. --- third_party/nix/src/libutil/serialise.hh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'third_party/nix/src/libutil/serialise.hh') diff --git a/third_party/nix/src/libutil/serialise.hh b/third_party/nix/src/libutil/serialise.hh index a5992b50ec6e..dc877487ee7e 100644 --- a/third_party/nix/src/libutil/serialise.hh +++ b/third_party/nix/src/libutil/serialise.hh @@ -135,9 +135,9 @@ struct StringSink : Sink { /* A source that reads data from a string. */ struct StringSource : Source { - const string& s; + const std::string& s; size_t pos; - StringSource(const string& _s) : s(_s), pos(0) {} + StringSource(const std::string& _s) : s(_s), pos(0) {} size_t read(unsigned char* data, size_t len) override; }; @@ -231,7 +231,7 @@ inline Sink& operator<<(Sink& sink, uint64_t n) { return sink; } -Sink& operator<<(Sink& sink, const string& s); +Sink& operator<<(Sink& sink, const std::string& s); Sink& operator<<(Sink& sink, const Strings& s); Sink& operator<<(Sink& sink, const StringSet& s); @@ -265,12 +265,12 @@ inline uint64_t readLongLong(Source& source) { void readPadding(size_t len, Source& source); size_t readString(unsigned char* buf, size_t max, Source& source); -string readString(Source& source, - size_t max = std::numeric_limits::max()); +std::string readString(Source& source, + size_t max = std::numeric_limits::max()); template T readStrings(Source& source); -Source& operator>>(Source& in, string& s); +Source& operator>>(Source& in, std::string& s); template Source& operator>>(Source& in, T& n) { -- cgit 1.4.1