diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/codec/c++/csv.hpp | 2 | ||||
-rw-r--r-- | modules/codec/c++/forst.tmpl.hpp | 18 | ||||
-rw-r--r-- | modules/codec/c++/schema_hash.hpp | 14 |
3 files changed, 18 insertions, 16 deletions
diff --git a/modules/codec/c++/csv.hpp b/modules/codec/c++/csv.hpp index 3cb11c2..2d11bff 100644 --- a/modules/codec/c++/csv.hpp +++ b/modules/codec/c++/csv.hpp @@ -209,6 +209,8 @@ public: template<typename ToDecode> static error_or<void> decode(data<Schema,encode::Csv>& from, data<Schema, ToDecode>& to){ + (void) to; + (void) from; return make_error<err::not_implemented>(); } diff --git a/modules/codec/c++/forst.tmpl.hpp b/modules/codec/c++/forst.tmpl.hpp index 6b2f74a..a52f0b9 100644 --- a/modules/codec/c++/forst.tmpl.hpp +++ b/modules/codec/c++/forst.tmpl.hpp @@ -31,13 +31,14 @@ public: template<typename... Members> struct forst_codec_info<schema::Struct<Members...> > { public: - static uint64_t max_layers(uint64_t i) constexpr noexcept { + template<uint64_t i> + static constexpr uint64_t max_layers() noexcept { if constexpr ( i < sizeof...(Members) ) { using MT = typename parameter_pack_type<i, Members...>::type; - constexpr uint64_t layer_i = forst_codec_info<typename MT::Type>::layers; + constexpr uint64_t layer_i = forst_codec_info<typename MT::ValueType>::layers; - constexpr uint64_t layer_next = max_layers(i+1u); + constexpr uint64_t layer_next = max_layers<i+1u>(); constexpr uint64_t layer_val = layer_i > layer_next ? layer_i : layer_next; @@ -46,19 +47,20 @@ public: return 0u; } public: - static constexpr uint64_t layers = max_layers(0u); + static constexpr uint64_t layers = max_layers<0u>(); }; template<typename... T> struct forst_codec_info<schema::Tuple<T...>> { public: - static uint64_t max_layers(uint64_t i) constexpr noexcept { - if constexpr ( i < sizeof...(Members) ) { + template<uint64_t i> + static constexpr uint64_t max_layers() noexcept { + if constexpr ( i < sizeof...(T) ) { using MT = typename parameter_pack_type<i, T...>::type; constexpr uint64_t layer_i = forst_codec_info<MT>::layers; - constexpr uint64_t layer_next = max_layers(i+1u); + constexpr uint64_t layer_next = max_layers<i+1u>(); constexpr uint64_t layer_val = layer_i > layer_next ? layer_i : layer_next; @@ -67,7 +69,7 @@ public: return 0u; } public: - static constexpr uint64_t layers = max_layers(0u); + static constexpr uint64_t layers = max_layers<0u>(); }; } } diff --git a/modules/codec/c++/schema_hash.hpp b/modules/codec/c++/schema_hash.hpp index 5e44497..4b537e1 100644 --- a/modules/codec/c++/schema_hash.hpp +++ b/modules/codec/c++/schema_hash.hpp @@ -137,19 +137,17 @@ struct schema_hash_seed<schema::Member<V,K>> { } }; -template<typename... V, string_literal... K> -struct schema_hash_seed<schema::Struct<schema::Member<V,K>...>> { - using Schema = schema::Struct<schema::Member<V,K>...>; +template<typename... Members> +struct schema_hash_seed<schema::Struct<Members...>> { + using Schema = schema::Struct<Members...>; template<uint64_t i> static constexpr uint32_t apply_ele(uint32_t seed){ - using Type = typename parameter_pack_type<i,V...>::type; - constexpr string_literal Lit = parameter_key_pack_type<i,K...>::literal; - using MemberT = typename parameter_pack_type<i,schema::Member<V,K>...>::type; + using MemberT = typename parameter_pack_type<i,Members...>::type; seed = schema_hash_seed<MemberT>::apply(seed); - if constexpr ( (i+1) < sizeof...(V) ){ + if constexpr ( (i+1) < sizeof...(Members) ){ return apply_ele<i+1>(seed); } return seed; @@ -157,7 +155,7 @@ struct schema_hash_seed<schema::Struct<schema::Member<V,K>...>> { static constexpr uint32_t apply(uint32_t seed){ seed = hash_literal<Schema::name>::apply(seed); - if constexpr (sizeof...(V) > 0){ + if constexpr (sizeof...(Members) > 0){ seed = apply_ele<0>(seed); } return seed; |