Bladeren bron

Simplify some template usage so that older compilers can handle it. (Users
report that MSVC 2003 in particular needs this change.)

kenton@google.com 17 jaren geleden
bovenliggende
commit
de75437573
1 gewijzigde bestanden met toevoegingen van 5 en 3 verwijderingen
  1. 5 3
      src/google/protobuf/descriptor.cc

+ 5 - 3
src/google/protobuf/descriptor.cc

@@ -1693,6 +1693,9 @@ class DescriptorBuilder {
   template<class DescriptorT> void AllocateOptions(
       const typename DescriptorT::OptionsType& orig_options,
       DescriptorT* descriptor);
+  // Specialization for FileOptions.
+  void AllocateOptions(const FileOptions& orig_options,
+                       FileDescriptor* descriptor);
 
   // Implementation for AllocateOptions(). Don't call this directly.
   template<class DescriptorT> void AllocateOptionsImpl(
@@ -2208,9 +2211,8 @@ template<class DescriptorT> void DescriptorBuilder::AllocateOptions(
 }
 
 // We specialize for FileDescriptor.
-template<> void DescriptorBuilder::AllocateOptions<FileDescriptor>(
-    const FileDescriptor::OptionsType& orig_options,
-    FileDescriptor* descriptor) {
+void DescriptorBuilder::AllocateOptions(const FileOptions& orig_options,
+                                        FileDescriptor* descriptor) {
   // We add the dummy token so that LookupSymbol does the right thing.
   AllocateOptionsImpl(descriptor->package() + ".dummy", descriptor->name(),
                       orig_options, descriptor);