diff options
author | 2015-10-09 12:38:31 -0700 | |
---|---|---|
committer | 2015-10-09 12:38:31 -0700 | |
commit | 49f24afb45b7add17af3ed4493fa0a94d1cc64da (patch) | |
tree | ffeba17cd9db828e86bb7318018305e6b4336d58 /src/google/protobuf/util | |
parent | 693cb3d22a605d758cd7e020b4f4bddfbb5ca10c (diff) | |
parent | 7c14dc837b2fcd61ed244ced90debeb4b42d1119 (diff) |
Merge pull request #815 from TeBoring/third-party
Use std::get where it's available
Diffstat (limited to 'src/google/protobuf/util')
3 files changed, 12 insertions, 5 deletions
diff --git a/src/google/protobuf/util/internal/protostream_objectwriter.cc b/src/google/protobuf/util/internal/protostream_objectwriter.cc index bd245999..08a2fb9a 100644 --- a/src/google/protobuf/util/internal/protostream_objectwriter.cc +++ b/src/google/protobuf/util/internal/protostream_objectwriter.cc @@ -1129,7 +1129,7 @@ Status ProtoStreamObjectWriter::RenderFieldMask(ProtoStreamObjectWriter* ow, // conversions as much as possible. Because ToSnakeCase sometimes returns the // wrong value. google::protobuf::scoped_ptr<ResultCallback1<util::Status, StringPiece> > callback( - NewPermanentCallback(&RenderOneFieldPath, ow)); + google::protobuf::internal::NewPermanentCallback(&RenderOneFieldPath, ow)); return DecodeCompactFieldMaskPaths(data.str(), callback.get()); } diff --git a/src/google/protobuf/util/internal/protostream_objectwriter_test.cc b/src/google/protobuf/util/internal/protostream_objectwriter_test.cc index 941fa71a..cb9f97f7 100644 --- a/src/google/protobuf/util/internal/protostream_objectwriter_test.cc +++ b/src/google/protobuf/util/internal/protostream_objectwriter_test.cc @@ -159,7 +159,12 @@ class BaseProtoStreamObjectWriterTest MATCHER_P(HasObjectLocation, expected, "Verifies the expected object location") { - string actual = std::tr1::get<0>(arg).ToString(); + string actual; +#if __cplusplus >= 201103L + actual = std::get<0>(arg).ToString(); +#else + actual = std::tr1::get<0>(arg).ToString(); +#endif if (actual.compare(expected) == 0) return true; *result_listener << "actual location is: " << actual; return false; diff --git a/src/google/protobuf/util/message_differencer.cc b/src/google/protobuf/util/message_differencer.cc index 9a268973..47237e5a 100644 --- a/src/google/protobuf/util/message_differencer.cc +++ b/src/google/protobuf/util/message_differencer.cc @@ -1363,9 +1363,11 @@ bool MessageDifferencer::MatchRepeatedFieldIndices( // doesn't neccessarily imply Compare(b, c). Therefore a naive greedy // algorithm will fail to find a maximum matching. // Here we use the argumenting path algorithm. - MaximumMatcher::NodeMatchCallback* callback = NewPermanentCallback( - this, &MessageDifferencer::IsMatch, repeated_field, key_comparator, - &message1, &message2, parent_fields); + MaximumMatcher::NodeMatchCallback* callback = + google::protobuf::internal::NewPermanentCallback( + this, &MessageDifferencer::IsMatch, + repeated_field, key_comparator, + &message1, &message2, parent_fields); MaximumMatcher matcher(count1, count2, callback, match_list1, match_list2); // If diff info is not needed, we should end the matching process as |