diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-09-02 02:42:56 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-09-02 02:42:56 +0000 |
commit | 7fb9ae9df3adcf49a4c02072739987c53dcce2df (patch) | |
tree | 756b563629a94b92e4347d609f16219dca5ad94e /src/google/protobuf/generated_message_reflection.cc | |
parent | b26684a900008982436dfc3f9cf2763ce2822b47 (diff) |
Make sure to quality calls to std::swap. Otherwise, if a google::swap() exists (e.g. because the user is using our own dense_hash_map implementation) it will be chosen instead, leading to a compile error.
Diffstat (limited to 'src/google/protobuf/generated_message_reflection.cc')
-rw-r--r-- | src/google/protobuf/generated_message_reflection.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc index d294e587..e04b93cc 100644 --- a/src/google/protobuf/generated_message_reflection.cc +++ b/src/google/protobuf/generated_message_reflection.cc @@ -324,7 +324,7 @@ void GeneratedMessageReflection::Swap( int has_bits_size = (descriptor_->field_count() + 31) / 32; for (int i = 0; i < has_bits_size; i++) { - swap(has_bits1[i], has_bits2[i]); + std::swap(has_bits1[i], has_bits2[i]); } for (int i = 0; i < descriptor_->field_count(); i++) { @@ -360,8 +360,8 @@ void GeneratedMessageReflection::Swap( switch (field->cpp_type()) { #define SWAP_VALUES(CPPTYPE, TYPE) \ case FieldDescriptor::CPPTYPE_##CPPTYPE: \ - swap(*MutableRaw<TYPE>(message1, field), \ - *MutableRaw<TYPE>(message2, field)); \ + std::swap(*MutableRaw<TYPE>(message1, field), \ + *MutableRaw<TYPE>(message2, field)); \ break; SWAP_VALUES(INT32 , int32 ); @@ -376,8 +376,8 @@ void GeneratedMessageReflection::Swap( #undef SWAP_VALUES case FieldDescriptor::CPPTYPE_STRING: - swap(*MutableRaw<string*>(message1, field), - *MutableRaw<string*>(message2, field)); + std::swap(*MutableRaw<string*>(message1, field), + *MutableRaw<string*>(message2, field)); break; default: |