diff options
Diffstat (limited to 'src/utils/cpp')
-rw-r--r-- | src/utils/cpp/hex_string.hpp | 2 | ||||
-rw-r--r-- | src/utils/cpp/type_safe_arithmetic.hpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/utils/cpp/hex_string.hpp b/src/utils/cpp/hex_string.hpp index 4b0124c4..5cca094a 100644 --- a/src/utils/cpp/hex_string.hpp +++ b/src/utils/cpp/hex_string.hpp @@ -44,7 +44,7 @@ [[nodiscard]] static inline auto FromHexString(std::string const& hexstring) -> std::optional<std::string> { try { - const std::size_t kHexBase = 16; + static constexpr std::size_t kHexBase = 16; std::stringstream ss{}; for (std::size_t i = 0; i < hexstring.length(); i += 2) { unsigned char c = diff --git a/src/utils/cpp/type_safe_arithmetic.hpp b/src/utils/cpp/type_safe_arithmetic.hpp index 1ff53ce8..2076a5bf 100644 --- a/src/utils/cpp/type_safe_arithmetic.hpp +++ b/src/utils/cpp/type_safe_arithmetic.hpp @@ -49,7 +49,7 @@ struct TypeSafeArithmeticTag { /// \tparam TAG The actual \ref TypeSafeArithmeticTag template <typename TAG> class TypeSafeArithmetic { - typename TAG::value_t m_value{}; + typename TAG::value_t value_{}; public: using tag_t = TAG; @@ -81,17 +81,17 @@ class TypeSafeArithmetic { } // NOLINTNEXTLINE - constexpr /*explicit*/ operator value_t() const { return m_value; } + constexpr /*explicit*/ operator value_t() const { return value_; } - constexpr auto get() const -> value_t { return m_value; } + constexpr auto get() const -> value_t { return value_; } constexpr void set(value_t value) { Expects(value >= kMinValue and value <= kMaxValue and "value output of range"); - m_value = value; + value_ = value; } - auto pointer() const -> const_pointer_t { return &m_value; } + auto pointer() const -> const_pointer_t { return &value_; } }; // template <typename TAG> |