From 30d4c8e5c26aa89a64998ef1da350d4d80359237 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 16 Jan 2024 09:01:36 +0100 Subject: cw --- serialize/packbits-write.hpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'serialize/packbits-write.hpp') diff --git a/serialize/packbits-write.hpp b/serialize/packbits-write.hpp index 09ec820e..5a8eae52 100644 --- a/serialize/packbits-write.hpp +++ b/serialize/packbits-write.hpp @@ -1,11 +1,12 @@ #pragma once #include "compat/assert.hpp" +#include "compat/reverse-index-sequence.hpp" #include #include #include #include -namespace floormat::detail_Pack_output { +namespace floormat::Pack { template struct output @@ -26,11 +27,6 @@ struct output_field T value; }; -template -constexpr std::index_sequence reverse_index_sequence(std::index_sequence); -template -using make_reverse_index_sequence = decltype(reverse_index_sequence(std::make_index_sequence{})); - template struct is_output_field : std::bool_constant {}; template struct is_output_field> : std::bool_constant { static_assert(N > 0); }; @@ -57,13 +53,17 @@ constexpr CORRADE_ALWAYS_INLINE T write_(const Tuple&, output return st.value; } +} // namespace floormat::Pack + +namespace floormat { + template -constexpr T write(const std::tuple...>& tuple) +constexpr T pack_write(const std::tuple...>& tuple) { constexpr size_t nbits = sizeof(T)*8; - return write_(tuple, output{T{0}}, make_reverse_index_sequence{}); + return Pack::write_(tuple, Pack::output{T{0}}, make_reverse_index_sequence{}); } -constexpr uint8_t write(const std::tuple<>&) = delete; +constexpr uint8_t pack_write(const std::tuple<>&) = delete; -} // namespace floormat::detail_Pack_output +} // namespace floormat -- cgit v1.2.3