diff options
author | Adam Cozzette <acozzette@google.com> | 2017-04-25 17:01:28 -0700 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2017-04-26 08:25:01 -0700 |
commit | 7c76ac1735a3b8f4523856bbd67588b6ccc7f850 (patch) | |
tree | b5198d8b815cfc08fdede21cd4a0969837b92930 /src/google/protobuf/stubs/common.h | |
parent | 4920e27a488976c9993cef686d868a846868eb56 (diff) | |
download | protobuf-7c76ac1735a3b8f4523856bbd67588b6ccc7f850.tar.gz protobuf-7c76ac1735a3b8f4523856bbd67588b6ccc7f850.tar.bz2 protobuf-7c76ac1735a3b8f4523856bbd67588b6ccc7f850.zip |
Remove "using namespace std" from stubs/common.h
This prevents the contents of the std namespace from being effectively
pulled into the top-level namespace in all translation units that
include common.h. I left in individual using statements for a few common
things like std::set and std::map, because it did not seem worth going
through the churn of updating the whole codebase to fix those right now.
Diffstat (limited to 'src/google/protobuf/stubs/common.h')
-rw-r--r-- | src/google/protobuf/stubs/common.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h index d2611498..20294503 100644 --- a/src/google/protobuf/stubs/common.h +++ b/src/google/protobuf/stubs/common.h @@ -35,7 +35,12 @@ #ifndef GOOGLE_PROTOBUF_COMMON_H__ #define GOOGLE_PROTOBUF_COMMON_H__ +#include <algorithm> +#include <iostream> +#include <map> +#include <set> #include <string> +#include <vector> #include <google/protobuf/stubs/port.h> #include <google/protobuf/stubs/macros.h> @@ -220,7 +225,14 @@ class FatalException : public std::exception { // This is at the end of the file instead of the beginning to work around a bug // in some versions of MSVC. -using namespace std; // Don't do this at home, kids. +// TODO(acozzette): remove these using statements +using std::istream; +using std::map; +using std::ostream; +using std::pair; +using std::set; +using std::string; +using std::vector; } // namespace protobuf } // namespace google |