From 274d9ea89d18d9f7cff2cf8bab14e411f7a47abd Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 31 May 2024 08:20:55 +0200 Subject: [PATCH] hashed_string: linter directives for accepted C-like arrays --- src/entt/core/hashed_string.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/entt/core/hashed_string.hpp b/src/entt/core/hashed_string.hpp index 3c1e8ff63..82762bf39 100644 --- a/src/entt/core/hashed_string.hpp +++ b/src/entt/core/hashed_string.hpp @@ -119,6 +119,7 @@ public: * @return The numeric representation of the string. */ template + // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) [[nodiscard]] static constexpr hash_type value(const value_type (&str)[N]) noexcept { return basic_hashed_string{str}; } @@ -150,8 +151,9 @@ public: * @param str Human-readable identifier. */ template + // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) constexpr basic_hashed_string(const value_type (&str)[N]) noexcept - : base_type{helper(str)} {} + : base_type{helper(static_cast(str))} {} /** * @brief Explicit constructor on purpose to avoid constructing a hashed @@ -219,6 +221,7 @@ basic_hashed_string(const Char *str, const std::size_t len) -> basic_hashed_stri * @param str Human-readable identifier. */ template +// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) basic_hashed_string(const Char (&str)[N]) -> basic_hashed_string; /**