diff --git a/CHANGELOG.md b/CHANGELOG.md index d86e3ba..7a37b6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. ## Next Release +### Enum + +- make mstd enum type clang-tidy conform + ## [0.2.1](https://github.com/repo/owner/releases/tag/0.2.1) - 2026-08-19 diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index 0ace569..15af4e1 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -79,41 +79,41 @@ static constexpr auto begin() { return values.begin(); } \ static constexpr auto end() { return values.end(); } \ \ - static constexpr std::string_view name(EnumName e) \ + static constexpr std::string_view name(EnumName enum_) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (values.at(i) == e) \ + if (values.at(i) == enum_) \ return names.at(i); \ return {}; \ } \ \ - static constexpr std::string toString(EnumName e) \ + static constexpr std::string toString(EnumName enum_) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (values.at(i) == e) \ + if (values.at(i) == enum_) \ return std::string(names.at(i)); \ return {}; \ } \ \ static constexpr std::optional from_string( \ - std::string_view s \ + std::string_view str \ ) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (names.at(i) == s) \ + if (names.at(i) == str) \ return values.at(i); \ return std::nullopt; \ } \ \ - static constexpr underlying_type to_underlying(EnumName e) \ + static constexpr underlying_type to_underlying(EnumName enum_) \ { \ - return static_cast(e); \ + return static_cast(enum_); \ } \ \ - static constexpr std::optional index(EnumName e) \ + static constexpr std::optional index(EnumName enum_) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (values.at(i) == e) \ + if (values.at(i) == enum_) \ return i; \ return std::nullopt; \ } \