aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/map_field.h
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2014-11-25 14:01:44 -0800
committerFeng Xiao <xfxyjwf@gmail.com>2014-11-25 14:01:44 -0800
commit6ae3bde73dd9090712e22986afe866229e61d305 (patch)
tree91175cad07b13034c3a9b574ca19182093a26653 /src/google/protobuf/map_field.h
parent7f3a25bebdcf732d7f43518c9b03a5a92b4be9e1 (diff)
downloadprotobuf-6ae3bde73dd9090712e22986afe866229e61d305.tar.gz
protobuf-6ae3bde73dd9090712e22986afe866229e61d305.tar.bz2
protobuf-6ae3bde73dd9090712e22986afe866229e61d305.zip
Fix issue 99.
Diffstat (limited to 'src/google/protobuf/map_field.h')
-rw-r--r--src/google/protobuf/map_field.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h
index 4ceaf4a0..0fad1351 100644
--- a/src/google/protobuf/map_field.h
+++ b/src/google/protobuf/map_field.h
@@ -213,6 +213,13 @@ class LIBPROTOBUF_EXPORT MapField : public MapFieldBase {
mutable const EntryType* default_entry_;
};
+// True if IsInitialized() is true for value field in all elements of t. T is
+// expected to be message. It's useful to have this helper here to keep the
+// protobuf compiler from ever having to emit loops in IsInitialized() methods.
+// We want the C++ compiler to inline this or not as it sees fit.
+template <typename Key, typename T>
+bool AllAreInitialized(const Map<Key, T>& t);
+
} // namespace internal
} // namespace protobuf