diff --git a/CHANGELOG.md b/CHANGELOG.md index e361c6f..8e64621 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 enum.hpp clang-tidy compliant + ## [0.1.4](https://github.com/repo/owner/releases/tag/0.1.4) - 2026-07-26 diff --git a/include/mstd/enum.hpp b/include/mstd/enum.hpp index 0e82041..a0b71ee 100644 --- a/include/mstd/enum.hpp +++ b/include/mstd/enum.hpp @@ -82,16 +82,16 @@ static constexpr std::string_view name(EnumName e) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (values[i] == e) \ - return names[i]; \ + if (values.at(i) == e) \ + return names.at(i); \ return {}; \ } \ \ static constexpr std::string toString(EnumName e) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (values[i] == e) \ - return std::string(names[i]); \ + if (values.at(i) == e) \ + return std::string(names.at(i)); \ return {}; \ } \ \ @@ -100,8 +100,8 @@ ) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (names[i] == s) \ - return values[i]; \ + if (names.at(i) == s) \ + return values.at(i); \ return std::nullopt; \ } \ \ @@ -113,7 +113,7 @@ static constexpr std::optional index(EnumName e) \ { \ for (std::size_t i = 0; i < size; ++i) \ - if (values[i] == e) \ + if (values.at(i) == e) \ return i; \ return std::nullopt; \ } \ @@ -146,4 +146,4 @@ ); \ } -#endif // __MSTD__ENUM_HPP__ \ No newline at end of file +#endif // __MSTD__ENUM_HPP__