diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2023-02-07 23:53:55 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2023-02-07 23:53:55 +0100 |
| commit | 74a223d1a9d23369c6c20457424b34cf17da95ab (patch) | |
| tree | 18ccf56b8ddc6274410150e7ad4b986e6cb7dbc5 /include/api-test/freelist.hpp | |
| parent | 9286a3db4f529f435ea4270ffc2ca7a7a1da922d (diff) | |
Remove presentation stuff from device class
Device instance is no more a pointer
Remove desc member in device structs
Diffstat (limited to 'include/api-test/freelist.hpp')
| -rw-r--r-- | include/api-test/freelist.hpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/api-test/freelist.hpp b/include/api-test/freelist.hpp index b231d9a..cfe8903 100644 --- a/include/api-test/freelist.hpp +++ b/include/api-test/freelist.hpp @@ -1,6 +1,7 @@ +#pragma once #include <numeric> #include <vector> - +#include <cassert> static constexpr uint32_t default_element_count = 1024U; @@ -27,6 +28,11 @@ class freelist { } T& operator[](uint32_t index) { + assert(index >= 0); + return items[index]; + } + + const T& operator[](uint32_t index) const { return items[index]; } @@ -41,11 +47,11 @@ class freelist { return invalid_id; } - auto begin() { + auto begin() const { return items.begin(); } - auto end() { + auto end() const { return items.end(); } |
