From 2e60941a2ef74df349699d98cd6ea842f2f3cad0 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 21 Feb 2023 09:49:32 -0800 Subject: [PATCH] Add static_assert for sizeof uchar_values array --- include/boost/charconv/from_chars.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/charconv/from_chars.hpp b/include/boost/charconv/from_chars.hpp index 4fe1f93..ae1d6cb 100644 --- a/include/boost/charconv/from_chars.hpp +++ b/include/boost/charconv/from_chars.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include @@ -63,6 +62,8 @@ static constexpr unsigned char uchar_values[] = 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255}; +static_assert(sizeof(uchar_values) == 256, "uchar_values should represent all 256 values of unsigned char"); + // Convert characters for 0-9, A-Z, a-z to 0-35. Anything else is 255 constexpr unsigned char digit_from_char(char val) noexcept {