Provide absl::InlinedVector specialization for N=0
Create an AOS version of the abseil InlinedVector that allows for N=0.
This provides a type that we can use to use stack-allocated memory for
the first N elements in a vector and then dynamically allocate all
subsequent memory.
Change-Id: Ia6d22a64deba1a841b188291bf79d2758ee94e99
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/containers/inlined_vector.h b/aos/containers/inlined_vector.h
new file mode 100644
index 0000000..abd375d
--- /dev/null
+++ b/aos/containers/inlined_vector.h
@@ -0,0 +1,18 @@
+#ifndef AOS_CONTAINERS_INLINED_VECTOR_H_
+#define AOS_CONTAINERS_INLINED_VECTOR_H_
+
+#include <vector>
+
+#include "absl/container/inlined_vector.h"
+
+namespace aos {
+
+template <typename T, size_t N>
+struct InlinedVector : public absl::InlinedVector<T, N> {};
+
+// Specialized for the N == 0 case because absl::InlinedVector doesn't support
+// it for some reason.
+template <typename T>
+struct InlinedVector<T, 0> : public std::vector<T> {};
+} // namespace aos
+#endif // AOS_CONTAINERS_INLINED_VECTOR_H_