From 50ffcfd82d23c55f795882909bdf3ede37a51138 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 18 Jan 2024 18:10:56 +0100 Subject: a --- serialize/packbits-read.hpp | 4 ++-- serialize/packbits-write.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/serialize/packbits-read.hpp b/serialize/packbits-read.hpp index 39146bea..9c814d22 100644 --- a/serialize/packbits-read.hpp +++ b/serialize/packbits-read.hpp @@ -83,8 +83,8 @@ template st, std::index_sequence) { using U = std::decay_t; - static_assert(Left <= sizeof(T)*8, "too few bits to read into tuple"); - static_assert(Left > 0, "too few bytes in datatype"); + static_assert(Left <= sizeof(T)*8, "bits to read count too large"); + static_assert(Left > 0, "too many bits to write"); static_assert(std::tuple_size_v >= sizeof...(Is)+1, "index count larger than tuple element count"); static_assert(I < std::tuple_size_v, "too few tuple elements"); using Field = std::decay_t>; diff --git a/serialize/packbits-write.hpp b/serialize/packbits-write.hpp index 12e202ac..7cece32b 100644 --- a/serialize/packbits-write.hpp +++ b/serialize/packbits-write.hpp @@ -35,13 +35,13 @@ template st, std::index_sequence) { static_assert(Capacity > 0); - static_assert(Left > 0); static_assert(Capacity <= sizeof(T)*8); - static_assert(Left <= Capacity); + static_assert(Left > 0, "too many bits to write"); + static_assert(Left <= Capacity, "too many bits to write"); static_assert(I < std::tuple_size_v, "too few tuple elements"); - static_assert(is_output_field(tuple))>>{}); + static_assert(is_output_field(tuple))>>{}, "tuple element must be output"); constexpr size_t N = std::tuple_element_t::Length; - static_assert(N <= Left); + static_assert(N <= Left, "too many bits to write"); T x = std::get(tuple).value; -- cgit v1.2.3