From 6c747d58f85d29987011d9519109928c3438fcef Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 14 Jan 2024 19:48:43 +0100 Subject: a --- serialize/packbits.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'serialize/packbits.cpp') diff --git a/serialize/packbits.cpp b/serialize/packbits.cpp index 6ed898c7..86c6f605 100644 --- a/serialize/packbits.cpp +++ b/serialize/packbits.cpp @@ -7,6 +7,8 @@ using namespace floormat::detail_Pack; namespace { +template constexpr inline T lowbits = (T{1} << N)-T{1}; + template using us_bits = Bits_; static_assert(!Storage{65535}.check_zero()); @@ -110,7 +112,30 @@ static_assert(std::is_same_v< make_tuple_type, std::tuple(); + using Tuple = std::tuple; + Tuple tuple{}; + assign_tuple2(tuple, Storage{(uint32_t)-1}, std::make_index_sequence<3>{}, + Bits_{}, Bits_{}, Bits_{}); + auto [a, b, c] = tuple; + + static_assert(lowbits != 0); + fm_assert(a == lowbits); + fm_assert(b == lowbits); + fm_assert(c & 1); + + //Assign::do_tuple(tuple, Storage{(uint32_t)-1}); + + return true; +} +static_assert(test4()); + +constexpr bool test5() +{ + auto st = Storage{0xB16B00B5}; + uint32_t a, b, c; + using Tuple = std::tuple; + auto t = Tuple{a, b, c}; + //assign_tuple, Tuple, return true; } -- cgit v1.2.3