Use std::size instead of sizeof(a) / sizeof(a[0]) pattern throughout the codebase.

This commit is contained in:
Lukas Tenbrink
2025-02-04 17:35:39 +01:00
parent f0f5319b0b
commit e34f1f504c
33 changed files with 71 additions and 67 deletions

View File

@@ -30,6 +30,8 @@
#include "error_list.h"
#include <iterator>
const char *error_names[] = {
"OK", // OK
"Failed", // FAILED
@@ -82,4 +84,4 @@ const char *error_names[] = {
"Printer on fire", // ERR_PRINTER_ON_FIRE
};
static_assert(sizeof(error_names) / sizeof(*error_names) == ERR_MAX);
static_assert(std::size(error_names) == ERR_MAX);