From aa886694c752b043bdbab99b624683eb10656d11 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jan 2024 02:01:42 +0100 Subject: serialize/pack: holy shit it works --- serialize/packbits-write.cpp | 11 +++++------ serialize/packbits-write.hpp | 14 -------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/serialize/packbits-write.cpp b/serialize/packbits-write.cpp index 416ee718..a5c80b49 100644 --- a/serialize/packbits-write.cpp +++ b/serialize/packbits-write.cpp @@ -23,11 +23,10 @@ static_assert(write_( std::make_index_sequence<3>{} ) == (1 << 6) - 1); -#if 0 -static_assert(write_(output{0}, - f32<2>{0b10}, - f32<3>{0b011}, - f32<3>{0b001}) == 0b000101110); -#endif +static_assert(write_( + std::tuple{f32<2>{0b10}, f32<3>{0b011}, f32<3>{0b001}}, + output{0}, + output_bits<32>{}, + make_reverse_index_sequence<3>{}) == 0b000101110); } // namespace floormat::detail_Pack_output diff --git a/serialize/packbits-write.hpp b/serialize/packbits-write.hpp index a98833ad..1a91cbcf 100644 --- a/serialize/packbits-write.hpp +++ b/serialize/packbits-write.hpp @@ -34,20 +34,6 @@ struct output_field template struct count_bits_; -template -struct count_bits_, Ts...>> -{ - static constexpr size_t length = N + count_bits_>::length; - static_assert(length <= sizeof(Int)*8); -}; - -template struct count_bits_> -{ - static constexpr size_t length = 0; -}; - -template constexpr inline size_t count_bits = count_bits_::length; - template constexpr std::index_sequence reverse_index_sequence(std::index_sequence const&); -- cgit v1.2.3