Initialize data members in constructors instead of direct initialize in

class definition, which is a C++11 extension.

Change-Id: I477fe484d737f4c60c519d68f431940ffaa33431
pull/225/head
Jisi Liu 10 years ago
parent f0e8df3b66
commit 329fa02b42
  1. 6
      src/google/protobuf/map_entry_lite.h

@ -359,7 +359,7 @@ class LIBPROTOBUF_EXPORT MapEntryLite : public MessageLite {
typedef void DestructorSkippable_; typedef void DestructorSkippable_;
}; };
MapEntryLite() : arena_(NULL) { MapEntryLite() : default_instance_(NULL), arena_(NULL) {
KeyCppHandler::Initialize(&key_, NULL); KeyCppHandler::Initialize(&key_, NULL);
ValueCppHandler::InitializeMaybeByDefaultEnum( ValueCppHandler::InitializeMaybeByDefaultEnum(
&value_, default_enum_value, NULL); &value_, default_enum_value, NULL);
@ -367,7 +367,7 @@ class LIBPROTOBUF_EXPORT MapEntryLite : public MessageLite {
} }
explicit MapEntryLite(Arena* arena) explicit MapEntryLite(Arena* arena)
: arena_(arena) { : default_instance_(NULL), arena_(arena) {
KeyCppHandler::Initialize(&key_, arena); KeyCppHandler::Initialize(&key_, arena);
ValueCppHandler::InitializeMaybeByDefaultEnum( ValueCppHandler::InitializeMaybeByDefaultEnum(
&value_, default_enum_value, arena); &value_, default_enum_value, arena);
@ -382,7 +382,7 @@ class LIBPROTOBUF_EXPORT MapEntryLite : public MessageLite {
default_instance_ = default_instance; default_instance_ = default_instance;
} }
MapEntryLite* default_instance_ = NULL; MapEntryLite* default_instance_;
KeyBase key_; KeyBase key_;
ValueBase value_; ValueBase value_;

Loading…
Cancel
Save