diff --git a/include/nameof.hpp b/include/nameof.hpp index f9fa3fd..82ce6f5 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -172,14 +172,14 @@ class [[nodiscard]] cstring { [[nodiscard]] constexpr const char* c_str() const noexcept { return data(); } - template, typename Allocator = std::allocator> + template , typename Allocator = std::allocator> [[nodiscard]] std::basic_string str() const { return {begin(), end()}; } [[nodiscard]] constexpr operator std::string_view() const noexcept { return {data(), size()}; } [[nodiscard]] constexpr explicit operator const char*() const noexcept { return data(); } - template, typename Allocator = std::allocator> + template , typename Allocator = std::allocator> [[nodiscard]] explicit operator std::basic_string() const { return {begin(), end()}; } }; @@ -245,7 +245,7 @@ template template std::basic_ostream& operator<<(std::basic_ostream& os, const cstring& srt) { - for (auto c : std::string_view{srt}) { + for (const auto c : std::string_view{srt}) { os.put(c); } @@ -536,7 +536,7 @@ class enum_traits { static constexpr std::string_view name(E value) noexcept { if (static_cast(value) >= static_cast(min_v) && static_cast(value) <= static_cast(max_v)) { if constexpr (sparsity_v) { - if (auto i = indexes_[static_cast(value) - min_v]; i != invalid_index_v) { + if (const auto i = indexes_[static_cast(value) - min_v]; i != invalid_index_v) { return strings_[i]; } } else {