From eb6f12c21335dcef24818bc2e3f5e2df43e25544 Mon Sep 17 00:00:00 2001 From: jeffro256 Date: Fri, 8 Nov 2024 15:06:28 -0600 Subject: [PATCH] serialization: silence warning about shifting uint8_t by 8 Some compilers are stupid and give a warning on this line when `T = uint8_t`, even though it will never run --- src/serialization/binary_archive.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/serialization/binary_archive.h b/src/serialization/binary_archive.h index bbab6ece9..59b63638f 100644 --- a/src/serialization/binary_archive.h +++ b/src/serialization/binary_archive.h @@ -197,7 +197,7 @@ struct binary_archive : public binary_archive_base { for (size_t i = 0; i < sizeof(T); i++) { stream_.put((char)(v & 0xff)); - if (1 < sizeof(T)) v >>= 8; + if constexpr (1 < sizeof(T)) { v >>= 8; } } }