aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/java/java_field.h
diff options
context:
space:
mode:
authorGravatar Ronny Krüger <rcane@rkxs.de>2018-04-16 09:58:24 +0200
committerGravatar Ronny Krüger <rcane@rkxs.de>2018-04-16 09:58:24 +0200
commit7d6d5f91320af20d77d57a198c54abe6e36a00ea (patch)
treea91c80c18a70f70ac5f8b94fb9951baa608d268d /src/google/protobuf/compiler/java/java_field.h
parent320d56c833f835f40c56bdaf2a375768cdd1b334 (diff)
Fixed a Visual Studio 2017 build error. (#4488)
The current 15.6.x versions of Visual Studio 2017 contain a bug that prevent them from compiling the following construct under certain conditions: std::unique_ptr<std::unique_ptr<Foo> []> foos; This will fail to compile if Foo is an abstract class. To work-around the problem the whole construct was change into: std::vector<std::unique_ptr<Foo>> foos; This not only fixes the compiler error but is also more readable than previous version.
Diffstat (limited to 'src/google/protobuf/compiler/java/java_field.h')
-rw-r--r--src/google/protobuf/compiler/java/java_field.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/java/java_field.h b/src/google/protobuf/compiler/java/java_field.h
index 04bbe24a..7275c099 100644
--- a/src/google/protobuf/compiler/java/java_field.h
+++ b/src/google/protobuf/compiler/java/java_field.h
@@ -138,7 +138,7 @@ class FieldGeneratorMap {
const Descriptor* descriptor_;
Context* context_;
ClassNameResolver* name_resolver_;
- std::unique_ptr<std::unique_ptr<FieldGeneratorType> []> field_generators_;
+ std::vector<std::unique_ptr<FieldGeneratorType>> field_generators_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap);
};