From 6a264d6f73515bf93ae5df864bedefe4ffb9fd4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <>
Date: Mon, 24 Mar 2025 23:29:32 -0400
Subject: [PATCH] infohash: constexpr HexMap constructor

---
 include/opendht/infohash.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/opendht/infohash.h b/include/opendht/infohash.h
index 29e152a3..a880ae80 100644
--- a/include/opendht/infohash.h
+++ b/include/opendht/infohash.h
@@ -345,8 +345,8 @@ Hash<N>::getRandom(Rd& rdev)
 }
 
 struct alignas(std::max_align_t) HexMap : public std::array<std::array<char, 2>, 256> {
-    HexMap() {
-        for (size_t i=0; i<size(); i++) {
+    constexpr HexMap() : std::array<std::array<char, 2>, 256>() {
+        for (size_t i = 0; i < size(); i++) {
             auto& e = (*this)[i];
             e[0] = hex_digits[(i >> 4) & 0x0F];
             e[1] = hex_digits[i & 0x0F];
-- 
GitLab