瀏覽代碼

Add std:: namespace prefix to set and map (#3332)

* Remove using std::{set,map}
tanderson-google 8 年之前
父節點
當前提交
126082c371
共有 39 個文件被更改,包括 82 次插入84 次删除
  1. 3 3
      conformance/conformance_test.cc
  2. 1 1
      conformance/conformance_test.h
  3. 2 2
      src/google/protobuf/compiler/csharp/csharp_field_base.cc
  4. 3 3
      src/google/protobuf/compiler/csharp/csharp_field_base.h
  5. 4 4
      src/google/protobuf/compiler/csharp/csharp_message.cc
  6. 1 1
      src/google/protobuf/compiler/javanano/javanano_enum_field.cc
  7. 3 3
      src/google/protobuf/compiler/javanano/javanano_enum_field.h
  8. 1 1
      src/google/protobuf/compiler/javanano/javanano_extension.cc
  9. 1 1
      src/google/protobuf/compiler/javanano/javanano_extension.h
  10. 3 3
      src/google/protobuf/compiler/javanano/javanano_field.cc
  11. 3 3
      src/google/protobuf/compiler/javanano/javanano_field.h
  12. 1 1
      src/google/protobuf/compiler/javanano/javanano_helpers.cc
  13. 1 1
      src/google/protobuf/compiler/javanano/javanano_helpers.h
  14. 1 1
      src/google/protobuf/compiler/javanano/javanano_map_field.cc
  15. 1 1
      src/google/protobuf/compiler/javanano/javanano_map_field.h
  16. 1 1
      src/google/protobuf/compiler/javanano/javanano_message.cc
  17. 1 1
      src/google/protobuf/compiler/javanano/javanano_message_field.cc
  18. 3 3
      src/google/protobuf/compiler/javanano/javanano_message_field.h
  19. 2 2
      src/google/protobuf/compiler/javanano/javanano_params.h
  20. 1 1
      src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
  21. 4 4
      src/google/protobuf/compiler/javanano/javanano_primitive_field.h
  22. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
  23. 1 1
      src/google/protobuf/compiler/objectivec/objectivec_enum_field.h
  24. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_extension.cc
  25. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_field.cc
  26. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_field.h
  27. 7 7
      src/google/protobuf/compiler/objectivec/objectivec_file.cc
  28. 9 9
      src/google/protobuf/compiler/objectivec/objectivec_helpers.cc
  29. 3 3
      src/google/protobuf/compiler/objectivec/objectivec_helpers.h
  30. 1 1
      src/google/protobuf/compiler/objectivec/objectivec_map_field.cc
  31. 1 1
      src/google/protobuf/compiler/objectivec/objectivec_map_field.h
  32. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_message.cc
  33. 1 1
      src/google/protobuf/compiler/objectivec/objectivec_message.h
  34. 3 3
      src/google/protobuf/compiler/objectivec/objectivec_message_field.cc
  35. 2 2
      src/google/protobuf/compiler/objectivec/objectivec_message_field.h
  36. 1 1
      src/google/protobuf/compiler/objectivec/objectivec_oneof.h
  37. 1 1
      src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc
  38. 0 2
      src/google/protobuf/stubs/common.h
  39. 1 1
      src/google/protobuf/testing/googletest.h

+ 3 - 3
conformance/conformance_test.cc

@@ -677,7 +677,7 @@ void ConformanceTestSuite::SetFailureList(const string& filename,
             std::inserter(expected_to_fail_, expected_to_fail_.end()));
 }
 
-bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check,
+bool ConformanceTestSuite::CheckSetEmpty(const std::set<string>& set_to_check,
                                          const std::string& write_to_file,
                                          const std::string& msg) {
   if (set_to_check.empty()) {
@@ -685,7 +685,7 @@ bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check,
   } else {
     StringAppendF(&output_, "\n");
     StringAppendF(&output_, "%s\n\n", msg.c_str());
-    for (set<string>::const_iterator iter = set_to_check.begin();
+    for (std::set<string>::const_iterator iter = set_to_check.begin();
          iter != set_to_check.end(); ++iter) {
       StringAppendF(&output_, "  %s\n", iter->c_str());
     }
@@ -694,7 +694,7 @@ bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check,
     if (!write_to_file.empty()) {
       std::ofstream os(write_to_file);
       if (os) {
-        for (set<string>::const_iterator iter = set_to_check.begin();
+        for (std::set<string>::const_iterator iter = set_to_check.begin();
              iter != set_to_check.end(); ++iter) {
           os << *iter << "\n";
         }

+ 1 - 1
conformance/conformance_test.h

@@ -205,7 +205,7 @@ class ConformanceTestSuite {
   void TestValidDataForType(
       google::protobuf::FieldDescriptor::Type,
       std::vector<std::pair<std::string, std::string>> values);
-  bool CheckSetEmpty(const set<string>& set_to_check,
+  bool CheckSetEmpty(const std::set<string>& set_to_check,
                      const std::string& write_to_file, const std::string& msg);
   ConformanceTestRunner* runner_;
   int successes_;

+ 2 - 2
src/google/protobuf/compiler/csharp/csharp_field_base.cc

@@ -54,7 +54,7 @@ namespace compiler {
 namespace csharp {
 
 void FieldGeneratorBase::SetCommonFieldVariables(
-    map<string, string>* variables) {
+    std::map<string, string>* variables) {
   // Note: this will be valid even though the tag emitted for packed and unpacked versions of
   // repeated fields varies by wire format. The wire format is encoded in the bottom 3 bits, which
   // never effects the tag size.
@@ -92,7 +92,7 @@ void FieldGeneratorBase::SetCommonFieldVariables(
 }
 
 void FieldGeneratorBase::SetCommonOneofFieldVariables(
-    map<string, string>* variables) {
+    std::map<string, string>* variables) {
   (*variables)["oneof_name"] = oneof_name();
   (*variables)["has_property_check"] =
     oneof_name() + "Case_ == " + oneof_property_name() +

+ 3 - 3
src/google/protobuf/compiler/csharp/csharp_field_base.h

@@ -66,14 +66,14 @@ class FieldGeneratorBase : public SourceGeneratorBase {
  protected:
   const FieldDescriptor* descriptor_;
   const int fieldOrdinal_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   void AddDeprecatedFlag(io::Printer* printer);
   void AddNullCheck(io::Printer* printer);
   void AddNullCheck(io::Printer* printer, const std::string& name);
 
   void AddPublicMemberAttributes(io::Printer* printer);
-  void SetCommonOneofFieldVariables(map<string, string>* variables);
+  void SetCommonOneofFieldVariables(std::map<string, string>* variables);
 
   std::string oneof_property_name();
   std::string oneof_name();
@@ -89,7 +89,7 @@ class FieldGeneratorBase : public SourceGeneratorBase {
   std::string capitalized_type_name();
 
  private:
-  void SetCommonFieldVariables(map<string, string>* variables);
+  void SetCommonFieldVariables(std::map<string, string>* variables);
   std::string GetStringDefaultValueInternal();
   std::string GetBytesDefaultValueInternal();
 

+ 4 - 4
src/google/protobuf/compiler/csharp/csharp_message.cc

@@ -105,7 +105,7 @@ void MessageGenerator::AddDeprecatedFlag(io::Printer* printer) {
 }
 
 void MessageGenerator::Generate(io::Printer* printer) {
-  map<string, string> vars;
+  std::map<string, string> vars;
   vars["class_name"] = class_name();
   vars["access_level"] = class_access_level();
 
@@ -280,7 +280,7 @@ bool MessageGenerator::HasNestedGeneratedTypes()
 }
 
 void MessageGenerator::GenerateCloningCode(io::Printer* printer) {
-  map<string, string> vars;
+  std::map<string, string> vars;
   WriteGeneratedCodeAttributes(printer);
   vars["class_name"] = class_name();
     printer->Print(
@@ -333,7 +333,7 @@ void MessageGenerator::GenerateFreezingCode(io::Printer* printer) {
 }
 
 void MessageGenerator::GenerateFrameworkMethods(io::Printer* printer) {
-    map<string, string> vars;
+    std::map<string, string> vars;
     vars["class_name"] = class_name();
 
     // Equality
@@ -432,7 +432,7 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
   // Note:  These are separate from GenerateMessageSerializationMethods()
   //   because they need to be generated even for messages that are optimized
   //   for code size.
-  map<string, string> vars;
+  std::map<string, string> vars;
   vars["class_name"] = class_name();
 
   WriteGeneratedCodeAttributes(printer);

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_enum_field.cc

@@ -52,7 +52,7 @@ namespace {
 // TODO(kenton):  Factor out a "SetCommonFieldVariables()" to get rid of
 //   repeat code between this and the other field types.
 void SetEnumVariables(const Params& params,
-    const FieldDescriptor* descriptor, map<string, string>* variables) {
+    const FieldDescriptor* descriptor, std::map<string, string>* variables) {
   (*variables)["name"] =
     RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
   (*variables)["capitalized_name"] =

+ 3 - 3
src/google/protobuf/compiler/javanano/javanano_enum_field.h

@@ -62,7 +62,7 @@ class EnumFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
   vector<string> canonical_values_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumFieldGenerator);
@@ -85,7 +85,7 @@ class AccessorEnumFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
   vector<string> canonical_values_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AccessorEnumFieldGenerator);
@@ -112,7 +112,7 @@ class RepeatedEnumFieldGenerator : public FieldGenerator {
   void GenerateRepeatedDataSizeCode(io::Printer* printer) const;
 
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
   vector<string> canonical_values_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedEnumFieldGenerator);

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_extension.cc

@@ -78,7 +78,7 @@ const char* GetTypeConstantName(const FieldDescriptor::Type type) {
 }  // namespace
 
 void SetVariables(const FieldDescriptor* descriptor, const Params params,
-                  map<string, string>* variables) {
+                  std::map<string, string>* variables) {
   (*variables)["extends"] = ClassName(params, descriptor->containing_type());
   (*variables)["name"] = RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
   bool repeated = descriptor->is_repeated();

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_extension.h

@@ -61,7 +61,7 @@ class ExtensionGenerator {
  private:
   const Params& params_;
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator);
 };

+ 3 - 3
src/google/protobuf/compiler/javanano/javanano_field.cc

@@ -151,7 +151,7 @@ const FieldGenerator& FieldGeneratorMap::get(
 }
 
 void SetCommonOneofVariables(const FieldDescriptor* descriptor,
-                             map<string, string>* variables) {
+                             std::map<string, string>* variables) {
   (*variables)["oneof_name"] =
       UnderscoresToCamelCase(descriptor->containing_oneof());
   (*variables)["oneof_capitalized_name"] =
@@ -169,7 +169,7 @@ void SetCommonOneofVariables(const FieldDescriptor* descriptor,
 }
 
 void GenerateOneofFieldEquals(const FieldDescriptor* descriptor,
-                              const map<string, string>& variables,
+                              const std::map<string, string>& variables,
                               io::Printer* printer) {
   if (GetJavaType(descriptor) == JAVATYPE_BYTES) {
     printer->Print(variables,
@@ -190,7 +190,7 @@ void GenerateOneofFieldEquals(const FieldDescriptor* descriptor,
 }
 
 void GenerateOneofFieldHashCode(const FieldDescriptor* descriptor,
-                                const map<string, string>& variables,
+                                const std::map<string, string>& variables,
                                 io::Printer* printer) {
   if (GetJavaType(descriptor) == JAVATYPE_BYTES) {
     printer->Print(variables,

+ 3 - 3
src/google/protobuf/compiler/javanano/javanano_field.h

@@ -114,12 +114,12 @@ class FieldGeneratorMap {
 };
 
 void SetCommonOneofVariables(const FieldDescriptor* descriptor,
-                             map<string, string>* variables);
+                             std::map<string, string>* variables);
 void GenerateOneofFieldEquals(const FieldDescriptor* descriptor,
-                              const map<string, string>& variables,
+                              const std::map<string, string>& variables,
                               io::Printer* printer);
 void GenerateOneofFieldHashCode(const FieldDescriptor* descriptor,
-                                const map<string, string>& variables,
+                                const std::map<string, string>& variables,
                                 io::Printer* printer);
 
 }  // namespace javanano

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_helpers.cc

@@ -567,7 +567,7 @@ string GenerateDifferentBit(int bit_index) {
 }
 
 void SetBitOperationVariables(const string name,
-    int bitIndex, map<string, string>* variables) {
+    int bitIndex, std::map<string, string>* variables) {
   (*variables)["get_" + name] = GenerateGetBit(bitIndex);
   (*variables)["set_" + name] = GenerateSetBit(bitIndex);
   (*variables)["clear_" + name] = GenerateClearBit(bitIndex);

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_helpers.h

@@ -181,7 +181,7 @@ string GenerateDifferentBit(int bit_index);
 // the given name of the bit, to the appropriate Java expressions for the given
 // bit index.
 void SetBitOperationVariables(const string name,
-    int bitIndex, map<string, string>* variables);
+    int bitIndex, std::map<string, string>* variables);
 
 inline bool IsMapEntry(const Descriptor* descriptor) {
   // TODO(liujisi): Add an option to turn on maps for proto2 syntax as well.

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_map_field.cc

@@ -84,7 +84,7 @@ const FieldDescriptor* ValueField(const FieldDescriptor* descriptor) {
 }
 
 void SetMapVariables(const Params& params,
-    const FieldDescriptor* descriptor, map<string, string>* variables) {
+    const FieldDescriptor* descriptor, std::map<string, string>* variables) {
   const FieldDescriptor* key = KeyField(descriptor);
   const FieldDescriptor* value = ValueField(descriptor);
   (*variables)["name"] =

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_map_field.h

@@ -58,7 +58,7 @@ class MapFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldGenerator);
 };

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_message.cc

@@ -182,7 +182,7 @@ void MessageGenerator::Generate(io::Printer* printer) {
   }
 
   // oneof
-  map<string, string> vars;
+  std::map<string, string> vars;
   vars["message_name"] = descriptor_->name();
   for (int i = 0; i < descriptor_->oneof_decl_count(); i++) {
     const OneofDescriptor* oneof_desc = descriptor_->oneof_decl(i);

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_message_field.cc

@@ -54,7 +54,7 @@ namespace {
 // TODO(kenton):  Factor out a "SetCommonFieldVariables()" to get rid of
 //   repeat code between this and the other field types.
 void SetMessageVariables(const Params& params,
-    const FieldDescriptor* descriptor, map<string, string>* variables) {
+    const FieldDescriptor* descriptor, std::map<string, string>* variables) {
   (*variables)["name"] =
     RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
   (*variables)["capitalized_name"] =

+ 3 - 3
src/google/protobuf/compiler/javanano/javanano_message_field.h

@@ -62,7 +62,7 @@ class MessageFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator);
 };
@@ -85,7 +85,7 @@ class MessageOneofFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageOneofFieldGenerator);
 };
@@ -108,7 +108,7 @@ class RepeatedMessageFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator);
 };

+ 2 - 2
src/google/protobuf/compiler/javanano/javanano_params.h

@@ -47,8 +47,8 @@ enum eMultipleFiles { JAVANANO_MUL_UNSET, JAVANANO_MUL_FALSE, JAVANANO_MUL_TRUE
 // Parameters for used by the generators
 class Params {
  public:
-  typedef map<string, string> NameMap;
-  typedef set<string> NameSet;
+  typedef std::map<string, string> NameMap;
+  typedef std::set<string> NameSet;
  private:
   string empty_;
   string base_name_;

+ 1 - 1
src/google/protobuf/compiler/javanano/javanano_primitive_field.cc

@@ -166,7 +166,7 @@ bool AllAscii(const string& text) {
 
 
 void SetPrimitiveVariables(const FieldDescriptor* descriptor, const Params params,
-                           map<string, string>* variables) {
+                           std::map<string, string>* variables) {
   (*variables)["name"] =
     RenameJavaKeywords(UnderscoresToCamelCase(descriptor));
   (*variables)["capitalized_name"] =

+ 4 - 4
src/google/protobuf/compiler/javanano/javanano_primitive_field.h

@@ -65,7 +65,7 @@ class PrimitiveFieldGenerator : public FieldGenerator {
   void GenerateSerializationConditional(io::Printer* printer) const;
 
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveFieldGenerator);
 };
@@ -89,7 +89,7 @@ class AccessorPrimitiveFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(AccessorPrimitiveFieldGenerator);
 };
@@ -111,7 +111,7 @@ class PrimitiveOneofFieldGenerator : public FieldGenerator {
 
  private:
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(PrimitiveOneofFieldGenerator);
 };
@@ -137,7 +137,7 @@ class RepeatedPrimitiveFieldGenerator : public FieldGenerator {
   void GenerateRepeatedDataSizeCode(io::Printer* printer) const;
 
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedPrimitiveFieldGenerator);
 };

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc

@@ -46,7 +46,7 @@ namespace objectivec {
 namespace {
 
 void SetEnumVariables(const FieldDescriptor* descriptor,
-                      map<string, string>* variables) {
+                      std::map<string, string>* variables) {
   string type = EnumName(descriptor->enum_type());
   (*variables)["storage_type"] = type;
   // For non repeated fields, if it was defined in a different file, the
@@ -118,7 +118,7 @@ void EnumFieldGenerator::GenerateCFunctionImplementations(
 }
 
 void EnumFieldGenerator::DetermineForwardDeclarations(
-    set<string>* fwd_decls) const {
+    std::set<string>* fwd_decls) const {
   SingleFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   // If it is an enum defined in a different file, then we'll need a forward
   // declaration for it.  When it is in our file, all the enums are output

+ 1 - 1
src/google/protobuf/compiler/objectivec/objectivec_enum_field.h

@@ -47,7 +47,7 @@ class EnumFieldGenerator : public SingleFieldGenerator {
  public:
   virtual void GenerateCFunctionDeclarations(io::Printer* printer) const;
   virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
-  virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
 
  protected:
   EnumFieldGenerator(const FieldDescriptor* descriptor, const Options& options);

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_extension.cc

@@ -59,7 +59,7 @@ ExtensionGenerator::ExtensionGenerator(const string& root_class_name,
 ExtensionGenerator::~ExtensionGenerator() {}
 
 void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
-  map<string, string> vars;
+  std::map<string, string> vars;
   vars["method_name"] = method_name_;
   SourceLocation location;
   if (descriptor_->GetSourceLocation(&location)) {
@@ -77,7 +77,7 @@ void ExtensionGenerator::GenerateMembersHeader(io::Printer* printer) {
 
 void ExtensionGenerator::GenerateStaticVariablesInitialization(
     io::Printer* printer) {
-  map<string, string> vars;
+  std::map<string, string> vars;
   vars["root_class_and_method_name"] = root_class_and_method_name_;
   vars["extended_type"] = ClassName(descriptor_->containing_type());
   vars["number"] = SimpleItoa(descriptor_->number());

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_field.cc

@@ -49,7 +49,7 @@ namespace objectivec {
 namespace {
 
 void SetCommonFieldVariables(const FieldDescriptor* descriptor,
-                             map<string, string>* variables) {
+                             std::map<string, string>* variables) {
   string camel_case_name = FieldName(descriptor);
   string raw_field_name;
   if (descriptor->type() == FieldDescriptor::TYPE_GROUP) {
@@ -178,7 +178,7 @@ void FieldGenerator::GenerateCFunctionImplementations(
 }
 
 void FieldGenerator::DetermineForwardDeclarations(
-    set<string>* fwd_decls) const {
+    std::set<string>* fwd_decls) const {
   // Nothing
 }
 

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_field.h

@@ -67,7 +67,7 @@ class FieldGenerator {
   virtual void GenerateCFunctionImplementations(io::Printer* printer) const;
 
   // Exposed for subclasses, should always call it on the parent class also.
-  virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
 
   // Used during generation, not intended to be extended by subclasses.
   void GenerateFieldDescription(
@@ -100,7 +100,7 @@ class FieldGenerator {
   virtual bool WantsHasProperty(void) const = 0;
 
   const FieldDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGenerator);

+ 7 - 7
src/google/protobuf/compiler/objectivec/objectivec_file.cc

@@ -89,7 +89,7 @@ bool FileContainsExtensions(const FileDescriptor* file) {
 void PruneFileAndDepsMarkingAsVisited(
     const FileDescriptor* file,
     vector<const FileDescriptor*>* files,
-    set<const FileDescriptor*>* files_visited) {
+    std::set<const FileDescriptor*>* files_visited) {
   vector<const FileDescriptor*>::iterator iter =
       std::find(files->begin(), files->end(), file);
   if (iter != files->end()) {
@@ -105,7 +105,7 @@ void PruneFileAndDepsMarkingAsVisited(
 void CollectMinimalFileDepsContainingExtensionsWorker(
     const FileDescriptor* file,
     vector<const FileDescriptor*>* files,
-    set<const FileDescriptor*>* files_visited) {
+    std::set<const FileDescriptor*>* files_visited) {
   if (files_visited->find(file) != files_visited->end()) {
     return;
   }
@@ -138,7 +138,7 @@ void CollectMinimalFileDepsContainingExtensionsWorker(
 void CollectMinimalFileDepsContainingExtensions(
     const FileDescriptor* file,
     vector<const FileDescriptor*>* files) {
-  set<const FileDescriptor*> files_visited;
+  std::set<const FileDescriptor*> files_visited;
   for (int i = 0; i < file->dependency_count(); i++) {
     const FileDescriptor* dep = file->dependency(i);
     CollectMinimalFileDepsContainingExtensionsWorker(dep, files,
@@ -229,12 +229,12 @@ void FileGenerator::GenerateHeader(io::Printer *printer) {
       "CF_EXTERN_C_BEGIN\n"
       "\n");
 
-  set<string> fwd_decls;
+  std::set<string> fwd_decls;
   for (vector<MessageGenerator *>::iterator iter = message_generators_.begin();
        iter != message_generators_.end(); ++iter) {
     (*iter)->DetermineForwardDeclarations(&fwd_decls);
   }
-  for (set<string>::const_iterator i(fwd_decls.begin());
+  for (std::set<string>::const_iterator i(fwd_decls.begin());
        i != fwd_decls.end(); ++i) {
     printer->Print("$value$;\n", "value", *i);
   }
@@ -325,7 +325,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
 
     // #import the headers for anything that a plain dependency of this proto
     // file (that means they were just an include, not a "public" include).
-    set<string> public_import_names;
+    std::set<string> public_import_names;
     for (int i = 0; i < file_->public_dependency_count(); i++) {
       public_import_names.insert(file_->public_dependency(i)->name());
     }
@@ -468,7 +468,7 @@ void FileGenerator::GenerateSource(io::Printer *printer) {
 
   // File descriptor only needed if there are messages to use it.
   if (message_generators_.size() > 0) {
-    map<string, string> vars;
+    std::map<string, string> vars;
     vars["root_class_name"] = root_class_name_;
     vars["package"] = file_->package();
     vars["objc_prefix"] = FileClassPrefix(file_);

+ 9 - 9
src/google/protobuf/compiler/objectivec/objectivec_helpers.cc

@@ -980,13 +980,13 @@ namespace {
 
 class ExpectedPrefixesCollector : public LineConsumer {
  public:
-  ExpectedPrefixesCollector(map<string, string>* inout_package_to_prefix_map)
+  ExpectedPrefixesCollector(std::map<string, string>* inout_package_to_prefix_map)
       : prefix_map_(inout_package_to_prefix_map) {}
 
   virtual bool ConsumeLine(const StringPiece& line, string* out_error);
 
  private:
-  map<string, string>* prefix_map_;
+  std::map<string, string>* prefix_map_;
 };
 
 bool ExpectedPrefixesCollector::ConsumeLine(
@@ -1009,7 +1009,7 @@ bool ExpectedPrefixesCollector::ConsumeLine(
 }
 
 bool LoadExpectedPackagePrefixes(const Options &generation_options,
-                                 map<string, string>* prefix_map,
+                                 std::map<string, string>* prefix_map,
                                  string* out_error) {
   if (generation_options.expected_prefixes_path.empty()) {
     return true;
@@ -1023,7 +1023,7 @@ bool LoadExpectedPackagePrefixes(const Options &generation_options,
 bool ValidateObjCClassPrefix(
     const FileDescriptor* file,
     const string& expected_prefixes_path,
-    const map<string, string>& expected_package_prefixes,
+    const std::map<string, string>& expected_package_prefixes,
     string* out_error) {
   const string prefix = file->options().objc_class_prefix();
   const string package = file->package();
@@ -1033,7 +1033,7 @@ bool ValidateObjCClassPrefix(
 
   // Check: Error - See if there was an expected prefix for the package and
   // report if it doesn't match (wrong or missing).
-  map<string, string>::const_iterator package_match =
+  std::map<string, string>::const_iterator package_match =
       expected_package_prefixes.find(package);
   if (package_match != expected_package_prefixes.end()) {
     // There was an entry, and...
@@ -1082,7 +1082,7 @@ bool ValidateObjCClassPrefix(
 
   // Look for any other package that uses the same prefix.
   string other_package_for_prefix;
-  for (map<string, string>::const_iterator i = expected_package_prefixes.begin();
+  for (std::map<string, string>::const_iterator i = expected_package_prefixes.begin();
        i != expected_package_prefixes.end(); ++i) {
     if (i->second == prefix) {
       other_package_for_prefix = i->first;
@@ -1150,7 +1150,7 @@ bool ValidateObjCClassPrefixes(const vector<const FileDescriptor*>& files,
                                const Options& generation_options,
                                string* out_error) {
   // Load the expected package prefixes, if available, to validate against.
-  map<string, string> expected_package_prefixes;
+  std::map<string, string> expected_package_prefixes;
   if (!LoadExpectedPackagePrefixes(generation_options,
                                    &expected_package_prefixes,
                                    out_error)) {
@@ -1519,7 +1519,7 @@ void ImportWriter::AddFile(const FileDescriptor* file,
     ParseFrameworkMappings();
   }
 
-  map<string, string>::iterator proto_lookup =
+  std::map<string, string>::iterator proto_lookup =
       proto_file_to_framework_name_.find(file->name());
   if (proto_lookup != proto_file_to_framework_name_.end()) {
     other_framework_imports_.push_back(
@@ -1640,7 +1640,7 @@ bool ImportWriter::ProtoFrameworkCollector::ConsumeLine(
     StringPiece proto_file(proto_file_list, start, offset - start);
     StringPieceTrimWhitespace(&proto_file);
     if (proto_file.size() != 0) {
-      map<string, string>::iterator existing_entry =
+      std::map<string, string>::iterator existing_entry =
           map_->find(proto_file.ToString());
       if (existing_entry != map_->end()) {
         std::cerr << "warning: duplicate proto file reference, replacing framework entry for '"

+ 3 - 3
src/google/protobuf/compiler/objectivec/objectivec_helpers.h

@@ -262,20 +262,20 @@ class LIBPROTOC_EXPORT ImportWriter {
  private:
   class ProtoFrameworkCollector : public LineConsumer {
    public:
-    ProtoFrameworkCollector(map<string, string>* inout_proto_file_to_framework_name)
+    ProtoFrameworkCollector(std::map<string, string>* inout_proto_file_to_framework_name)
         : map_(inout_proto_file_to_framework_name) {}
 
     virtual bool ConsumeLine(const StringPiece& line, string* out_error);
 
    private:
-    map<string, string>* map_;
+    std::map<string, string>* map_;
   };
 
   void ParseFrameworkMappings();
 
   const string generate_for_named_framework_;
   const string named_framework_to_proto_path_mappings_path_;
-  map<string, string> proto_file_to_framework_name_;
+  std::map<string, string> proto_file_to_framework_name_;
   bool need_to_parse_mapping_file_;
 
   vector<string> protobuf_framework_imports_;

+ 1 - 1
src/google/protobuf/compiler/objectivec/objectivec_map_field.cc

@@ -162,7 +162,7 @@ void MapFieldGenerator::FinishInitialization(void) {
 }
 
 void MapFieldGenerator::DetermineForwardDeclarations(
-    set<string>* fwd_decls) const {
+    std::set<string>* fwd_decls) const {
   RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   const FieldDescriptor* value_descriptor =
       descriptor_->message_type()->FindFieldByName("value");

+ 1 - 1
src/google/protobuf/compiler/objectivec/objectivec_map_field.h

@@ -51,7 +51,7 @@ class MapFieldGenerator : public RepeatedFieldGenerator {
   MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options);
   virtual ~MapFieldGenerator();
 
-  virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
 
  private:
   scoped_ptr<FieldGenerator> value_field_generator_;

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_message.cc

@@ -233,7 +233,7 @@ void MessageGenerator::GenerateStaticVariablesInitialization(
   }
 }
 
-void MessageGenerator::DetermineForwardDeclarations(set<string>* fwd_decls) {
+void MessageGenerator::DetermineForwardDeclarations(std::set<string>* fwd_decls) {
   if (!IsMapEntryMessage(descriptor_)) {
     for (int i = 0; i < descriptor_->field_count(); i++) {
       const FieldDescriptor* fieldDescriptor = descriptor_->field(i);
@@ -514,7 +514,7 @@ void MessageGenerator::GenerateSource(io::Printer* printer) {
           "    };\n");
     }
 
-    map<string, string> vars;
+    std::map<string, string> vars;
     vars["classname"] = class_name_;
     vars["rootclassname"] = root_classname_;
     vars["fields"] = has_fields ? "fields" : "NULL";

+ 1 - 1
src/google/protobuf/compiler/objectivec/objectivec_message.h

@@ -64,7 +64,7 @@ class MessageGenerator {
   void GenerateMessageHeader(io::Printer* printer);
   void GenerateSource(io::Printer* printer);
   void GenerateExtensionRegistrationSource(io::Printer* printer);
-  void DetermineForwardDeclarations(set<string>* fwd_decls);
+  void DetermineForwardDeclarations(std::set<string>* fwd_decls);
 
   // Checks if the message or a nested message includes a oneof definition.
   bool IncludesOneOfDefinition() const;

+ 3 - 3
src/google/protobuf/compiler/objectivec/objectivec_message_field.cc

@@ -45,7 +45,7 @@ namespace objectivec {
 namespace {
 
 void SetMessageVariables(const FieldDescriptor* descriptor,
-                         map<string, string>* variables) {
+                         std::map<string, string>* variables) {
   const string& message_type = ClassName(descriptor->message_type());
   (*variables)["type"] = message_type;
   (*variables)["containing_class"] = ClassName(descriptor->containing_type());
@@ -67,7 +67,7 @@ MessageFieldGenerator::MessageFieldGenerator(const FieldDescriptor* descriptor,
 MessageFieldGenerator::~MessageFieldGenerator() {}
 
 void MessageFieldGenerator::DetermineForwardDeclarations(
-    set<string>* fwd_decls) const {
+    std::set<string>* fwd_decls) const {
   ObjCObjFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   // Class name is already in "storage_type".
   fwd_decls->insert("@class " + variable("storage_type"));
@@ -95,7 +95,7 @@ RepeatedMessageFieldGenerator::RepeatedMessageFieldGenerator(
 RepeatedMessageFieldGenerator::~RepeatedMessageFieldGenerator() {}
 
 void RepeatedMessageFieldGenerator::DetermineForwardDeclarations(
-    set<string>* fwd_decls) const {
+    std::set<string>* fwd_decls) const {
   RepeatedFieldGenerator::DetermineForwardDeclarations(fwd_decls);
   // Class name is already in "storage_type".
   fwd_decls->insert("@class " + variable("storage_type"));

+ 2 - 2
src/google/protobuf/compiler/objectivec/objectivec_message_field.h

@@ -51,7 +51,7 @@ class MessageFieldGenerator : public ObjCObjFieldGenerator {
   virtual bool WantsHasProperty(void) const;
 
  public:
-  virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
 
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MessageFieldGenerator);
@@ -67,7 +67,7 @@ class RepeatedMessageFieldGenerator : public RepeatedFieldGenerator {
   virtual ~RepeatedMessageFieldGenerator();
 
  public:
-  virtual void DetermineForwardDeclarations(set<string>* fwd_decls) const;
+  virtual void DetermineForwardDeclarations(std::set<string>* fwd_decls) const;
 
  private:
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(RepeatedMessageFieldGenerator);

+ 1 - 1
src/google/protobuf/compiler/objectivec/objectivec_oneof.h

@@ -67,7 +67,7 @@ class OneofGenerator {
 
  private:
   const OneofDescriptor* descriptor_;
-  map<string, string> variables_;
+  std::map<string, string> variables_;
 
   GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OneofGenerator);
 };

+ 1 - 1
src/google/protobuf/compiler/objectivec/objectivec_primitive_field.cc

@@ -118,7 +118,7 @@ const char* PrimitiveArrayTypeName(const FieldDescriptor* descriptor) {
 }
 
 void SetPrimitiveVariables(const FieldDescriptor* descriptor,
-                           map<string, string>* variables) {
+                           std::map<string, string>* variables) {
   std::string primitive_name = PrimitiveTypeName(descriptor);
   (*variables)["type"] = primitive_name;
   (*variables)["storage_type"] = primitive_name;

+ 0 - 2
src/google/protobuf/stubs/common.h

@@ -227,10 +227,8 @@ class FatalException : public std::exception {
 // in some versions of MSVC.
 // 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;
 

+ 1 - 1
src/google/protobuf/testing/googletest.h

@@ -85,7 +85,7 @@ class ScopedMemoryLog {
   const vector<string>& GetMessages(LogLevel error);
 
  private:
-  map<LogLevel, vector<string> > messages_;
+  std::map<LogLevel, vector<string> > messages_;
   LogHandler* old_handler_;
 
   static void HandleLog(LogLevel level, const char* filename, int line,