blob: a92e46bdcda1ecf79a392d204c55c76cc3f82108 [file] [log] [blame]
James Kuszmaul65891e02023-11-06 13:09:07 -08001#ifndef AOS_CONTAINERS_INLINED_VECTOR_H_
2#define AOS_CONTAINERS_INLINED_VECTOR_H_
3
Stephan Pleines5fc35072024-05-22 17:33:18 -07004#include <stddef.h>
5
James Kuszmaul65891e02023-11-06 13:09:07 -08006#include <vector>
7
8#include "absl/container/inlined_vector.h"
9
10namespace aos {
11
12template <typename T, size_t N>
James Kuszmaul847927d2024-05-23 15:33:18 -070013struct InlinedVector : public absl::InlinedVector<T, N> {
14 public:
15 using absl::InlinedVector<T, N>::InlinedVector;
16};
James Kuszmaul65891e02023-11-06 13:09:07 -080017
18// Specialized for the N == 0 case because absl::InlinedVector doesn't support
19// it for some reason.
20template <typename T>
James Kuszmaul847927d2024-05-23 15:33:18 -070021struct InlinedVector<T, 0> : public std::vector<T> {
22 public:
23 using std::vector<T>::vector;
24};
James Kuszmaul65891e02023-11-06 13:09:07 -080025} // namespace aos
26#endif // AOS_CONTAINERS_INLINED_VECTOR_H_