Unverified Commit 9497a657 authored by Adam Cozzette's avatar Adam Cozzette Committed by GitHub

Merge pull request #4517 from rcane/feature/vc2017_build_fix

Fixed a Visual Studio 2017 build error. (#4488)
parents a9d9326a 7d6d5f91
......@@ -117,8 +117,7 @@ FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor,
SCCAnalyzer* scc_analyzer)
: descriptor_(descriptor),
options_(options),
field_generators_(
new std::unique_ptr<FieldGenerator>[descriptor->field_count()]) {
field_generators_(descriptor->field_count()) {
// Construct all the FieldGenerators.
for (int i = 0; i < descriptor->field_count(); i++) {
field_generators_[i].reset(
......
......@@ -203,7 +203,7 @@ class FieldGeneratorMap {
private:
const Descriptor* descriptor_;
const Options& options_;
std::unique_ptr<std::unique_ptr<FieldGenerator> []> field_generators_;
std::vector<std::unique_ptr<FieldGenerator>> field_generators_;
static FieldGenerator* MakeGenerator(const FieldDescriptor* field,
const Options& options,
......
......@@ -211,8 +211,7 @@ template <>
FieldGeneratorMap<ImmutableFieldGenerator>::FieldGeneratorMap(
const Descriptor* descriptor, Context* context)
: descriptor_(descriptor),
field_generators_(new std::unique_ptr<
ImmutableFieldGenerator>[descriptor->field_count()]) {
field_generators_(descriptor->field_count()) {
// Construct all the FieldGenerators and assign them bit indices for their
// bit fields.
......@@ -234,8 +233,7 @@ template <>
FieldGeneratorMap<ImmutableFieldLiteGenerator>::FieldGeneratorMap(
const Descriptor* descriptor, Context* context)
: descriptor_(descriptor),
field_generators_(new std::unique_ptr<
ImmutableFieldLiteGenerator>[descriptor->field_count()]) {
field_generators_(descriptor->field_count()) {
// Construct all the FieldGenerators and assign them bit indices for their
// bit fields.
int messageBitIndex = 0;
......
......@@ -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);
};
......
......@@ -186,10 +186,8 @@ FileGenerator::FileGenerator(const FileDescriptor* file, const Options& options,
bool immutable_api)
: file_(file),
java_package_(FileJavaPackage(file, immutable_api)),
message_generators_(
new std::unique_ptr<MessageGenerator>[file->message_type_count()]),
extension_generators_(
new std::unique_ptr<ExtensionGenerator>[file->extension_count()]),
message_generators_(file->message_type_count()),
extension_generators_(file->extension_count()),
context_(new Context(file, options)),
name_resolver_(context_->GetNameResolver()),
options_(options),
......
......@@ -98,8 +98,8 @@ class FileGenerator {
string java_package_;
string classname_;
std::unique_ptr<std::unique_ptr<MessageGenerator> []> message_generators_;
std::unique_ptr<std::unique_ptr<ExtensionGenerator> []> extension_generators_;
std::vector<std::unique_ptr<MessageGenerator>> message_generators_;
std::vector<std::unique_ptr<ExtensionGenerator>> extension_generators_;
std::unique_ptr<GeneratorFactory> generator_factory_;
std::unique_ptr<Context> context_;
ClassNameResolver* name_resolver_;
......
......@@ -410,10 +410,8 @@ bool RepeatedFieldGenerator::RuntimeUsesHasBit(void) const {
FieldGeneratorMap::FieldGeneratorMap(const Descriptor* descriptor,
const Options& options)
: descriptor_(descriptor),
field_generators_(
new std::unique_ptr<FieldGenerator>[descriptor->field_count()]),
extension_generators_(
new std::unique_ptr<FieldGenerator>[descriptor->extension_count()]) {
field_generators_(descriptor->field_count()),
extension_generators_(descriptor->extension_count()) {
// Construct all the FieldGenerators.
for (int i = 0; i < descriptor->field_count(); i++) {
field_generators_[i].reset(
......
......@@ -182,8 +182,8 @@ class FieldGeneratorMap {
private:
const Descriptor* descriptor_;
std::unique_ptr<std::unique_ptr<FieldGenerator>[]> field_generators_;
std::unique_ptr<std::unique_ptr<FieldGenerator>[]> extension_generators_;
std::vector<std::unique_ptr<FieldGenerator>> field_generators_;
std::vector<std::unique_ptr<FieldGenerator>> extension_generators_;
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(FieldGeneratorMap);
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment