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/strutil.cc | |
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/strutil.cc')
-rw-r--r-- | src/google/protobuf/stubs/strutil.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc index 15b6e53f..336894b5 100644 --- a/src/google/protobuf/stubs/strutil.cc +++ b/src/google/protobuf/stubs/strutil.cc @@ -227,7 +227,7 @@ void SplitStringToIteratorUsing(const string& full, void SplitStringUsing(const string& full, const char* delim, vector<string>* result) { - back_insert_iterator< vector<string> > it(*result); + std::back_insert_iterator< vector<string> > it(*result); SplitStringToIteratorUsing(full, delim, it); } @@ -265,7 +265,7 @@ void SplitStringToIteratorAllowEmpty(const StringType& full, void SplitStringAllowEmpty(const string& full, const char* delim, vector<string>* result) { - back_insert_iterator<vector<string> > it(*result); + std::back_insert_iterator<vector<string> > it(*result); SplitStringToIteratorAllowEmpty(full, delim, 0, it); } @@ -1262,10 +1262,10 @@ char* DoubleToBuffer(double value, char* buffer) { // this assert. GOOGLE_COMPILE_ASSERT(DBL_DIG < 20, DBL_DIG_is_too_big); - if (value == numeric_limits<double>::infinity()) { + if (value == std::numeric_limits<double>::infinity()) { strcpy(buffer, "inf"); return buffer; - } else if (value == -numeric_limits<double>::infinity()) { + } else if (value == -std::numeric_limits<double>::infinity()) { strcpy(buffer, "-inf"); return buffer; } else if (MathLimits<double>::IsNaN(value)) { @@ -1380,10 +1380,10 @@ char* FloatToBuffer(float value, char* buffer) { // this assert. GOOGLE_COMPILE_ASSERT(FLT_DIG < 10, FLT_DIG_is_too_big); - if (value == numeric_limits<double>::infinity()) { + if (value == std::numeric_limits<double>::infinity()) { strcpy(buffer, "inf"); return buffer; - } else if (value == -numeric_limits<double>::infinity()) { + } else if (value == -std::numeric_limits<double>::infinity()) { strcpy(buffer, "-inf"); return buffer; } else if (MathLimits<float>::IsNaN(value)) { |