FixedArrayList compile time assert #740

Merged
mohr merged 4 commits from eive/fsfw:container_additional_assert into development 2023-05-08 14:04:57 +02:00
1 changed files with 1 additions and 0 deletions
Showing only changes of commit f735c2e9d4 - Show all commits

View File

@ -12,6 +12,7 @@ template <typename T, size_t MAX_SIZE, typename count_t = uint8_t>
class FixedArrayList : public ArrayList<T, count_t> {
static_assert(MAX_SIZE <= std::numeric_limits<count_t>::max(),
"count_t is not large enough to hold MAX_SIZE");
static_assert(MAX_SIZE > 0, "MAX_SIZE is 0");
private:
T data[MAX_SIZE];