aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/map_field_inl.h
diff options
context:
space:
mode:
authorGravatar Feng Xiao <xfxyjwf@gmail.com>2014-11-25 14:01:44 -0800
committerGravatar Feng Xiao <xfxyjwf@gmail.com>2014-11-25 14:01:44 -0800
commit6ae3bde73dd9090712e22986afe866229e61d305 (patch)
tree91175cad07b13034c3a9b574ca19182093a26653 /src/google/protobuf/map_field_inl.h
parent7f3a25bebdcf732d7f43518c9b03a5a92b4be9e1 (diff)
Fix issue 99.
Diffstat (limited to 'src/google/protobuf/map_field_inl.h')
-rw-r--r--src/google/protobuf/map_field_inl.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/google/protobuf/map_field_inl.h b/src/google/protobuf/map_field_inl.h
index 6f17df95..79302e48 100644
--- a/src/google/protobuf/map_field_inl.h
+++ b/src/google/protobuf/map_field_inl.h
@@ -262,6 +262,15 @@ void MapField<Key, T, KeyProto, ValueProto,
}
}
+template <typename Key, typename T>
+bool AllAreInitialized(const Map<Key, T>& t) {
+ for (typename Map<Key, T>::const_iterator it = t.begin(); it != t.end();
+ ++it) {
+ if (!it->second.IsInitialized()) return false;
+ }
+ return true;
+}
+
} // namespace internal
} // namespace protobuf