diff options
-rw-r--r-- | serialize/packbits-write.cpp | 11 | ||||
-rw-r--r-- | 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<u32, 32>{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<u32, 32>{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<std::unsigned_integral Type, typename Tuple> struct count_bits_; -template<std::unsigned_integral Int, size_t N, typename... Ts> -struct count_bits_<Int, std::tuple<output_field<Int, N>, Ts...>> -{ - static constexpr size_t length = N + count_bits_<Int, std::tuple<Ts...>>::length; - static_assert(length <= sizeof(Int)*8); -}; - -template<std::unsigned_integral Int> struct count_bits_<Int, std::tuple<>> -{ - static constexpr size_t length = 0; -}; - -template<typename T, typename Tuple> constexpr inline size_t count_bits = count_bits_<T, Tuple>::length; - template <std::size_t ... Is> constexpr std::index_sequence<sizeof...(Is)-1uz-Is...> reverse_index_sequence(std::index_sequence<Is...> const&); |