James Kuszmaul | 65891e0 | 2023-11-06 13:09:07 -0800 | [diff] [blame] | 1 | #ifndef AOS_CONTAINERS_INLINED_VECTOR_H_ |
| 2 | #define AOS_CONTAINERS_INLINED_VECTOR_H_ |
| 3 | |
Stephan Pleines | 5fc3507 | 2024-05-22 17:33:18 -0700 | [diff] [blame] | 4 | #include <stddef.h> |
| 5 | |
James Kuszmaul | 65891e0 | 2023-11-06 13:09:07 -0800 | [diff] [blame] | 6 | #include <vector> |
| 7 | |
| 8 | #include "absl/container/inlined_vector.h" |
| 9 | |
| 10 | namespace aos { |
| 11 | |
| 12 | template <typename T, size_t N> |
James Kuszmaul | 847927d | 2024-05-23 15:33:18 -0700 | [diff] [blame^] | 13 | struct InlinedVector : public absl::InlinedVector<T, N> { |
| 14 | public: |
| 15 | using absl::InlinedVector<T, N>::InlinedVector; |
| 16 | }; |
James Kuszmaul | 65891e0 | 2023-11-06 13:09:07 -0800 | [diff] [blame] | 17 | |
| 18 | // Specialized for the N == 0 case because absl::InlinedVector doesn't support |
| 19 | // it for some reason. |
| 20 | template <typename T> |
James Kuszmaul | 847927d | 2024-05-23 15:33:18 -0700 | [diff] [blame^] | 21 | struct InlinedVector<T, 0> : public std::vector<T> { |
| 22 | public: |
| 23 | using std::vector<T>::vector; |
| 24 | }; |
James Kuszmaul | 65891e0 | 2023-11-06 13:09:07 -0800 | [diff] [blame] | 25 | } // namespace aos |
| 26 | #endif // AOS_CONTAINERS_INLINED_VECTOR_H_ |