diff --git a/Numeric/NumericCoder.hpp b/Numeric/NumericCoder.hpp index 26f906baa..ab8d48ad8 100644 --- a/Numeric/NumericCoder.hpp +++ b/Numeric/NumericCoder.hpp @@ -23,19 +23,20 @@ template class NumericCoder { /// Modifies @c target to hold @c value at @c index. template static void encode(int &target, int value) { static_assert(index < sizeof...(Sizes), "Index must be within range"); - NumericEncoderImp::template encode(target, value); + NumericEncoder::template encode(target, value); } + /// @returns The value from @c source at @c index. template static int decode(int source) { static_assert(index < sizeof...(Sizes), "Index must be within range"); - return NumericEncoderImp::template decode(source); + return NumericDecoder::template decode(source); } private: template - struct NumericEncoderImp { - template static void encode(int &target, int value) { + struct NumericEncoder { + template static void encode(int &target, int value) { if constexpr (i == index) { const int suffix = target % divider; target /= divider; @@ -44,18 +45,20 @@ template class NumericCoder { target *= divider; target += suffix; } else { - NumericEncoderImp::template encode(target, value); + NumericEncoder::template encode(target, value); } } + }; - template static int decode(int source) { + template + struct NumericDecoder { + template static int decode(int source) { if constexpr (i == index) { return (source / divider) % size; } else { - return NumericEncoderImp::template decode(source); + return NumericDecoder::template decode(source); } } - }; };