From 74a223d1a9d23369c6c20457424b34cf17da95ab Mon Sep 17 00:00:00 2001 From: ladevieq Date: Tue, 7 Feb 2023 23:53:55 +0100 Subject: Remove presentation stuff from device class Device instance is no more a pointer Remove desc member in device structs --- include/api-test/freelist.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include/api-test/freelist.hpp') 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 #include - +#include 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(); } -- cgit v1.3