diff options
Diffstat (limited to 'modules/codec/c++/forst.tmpl.hpp')
-rw-r--r-- | modules/codec/c++/forst.tmpl.hpp | 18 |
1 files changed, 10 insertions, 8 deletions
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>(); }; } } |