This commit is contained in:
Niklas Gollenstede
2025-10-31 22:37:36 +01:00
commit 174fe17e89
197 changed files with 79558 additions and 0 deletions

17
kernel/utils/size.h Normal file
View File

@@ -0,0 +1,17 @@
/*! \file
* \brief Template function to determine the length of an array
*/
#pragma once
#include "../types.h"
/* \brief Helper to retrieve the number of elements in an array
* (Warning: template magic)
* \param Array
* \return Number of elements
*/
template <class T, size_t N>
constexpr size_t size(T (& /*unused*/)[N]) {
return N;
}