diff options
Diffstat (limited to 'include/fud_string.hpp')
-rw-r--r-- | include/fud_string.hpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/fud_string.hpp b/include/fud_string.hpp index 1c189c2..2c2173b 100644 --- a/include/fud_string.hpp +++ b/include/fud_string.hpp @@ -133,8 +133,7 @@ class String { if constexpr (std::is_same_v<decltype(cStringItem), const char*>) { cString = cStringItem; } else if constexpr (std::is_same_v<decltype(cStringItem), const utf8*>) { - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) - cString = reinterpret_cast<const char*>(cStringItem); + cString = std::bit_cast<const char*>(cStringItem); } else { static_assert(!std::is_same_v<decltype(cStringItem), const char*>); } @@ -275,8 +274,7 @@ class String { /** \brief The underlying data as an explicit c string. */ [[nodiscard]] const char* c_str() const { - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) - return reinterpret_cast<const char*>(data()); + return std::bit_cast<const char*>(data()); } [[nodiscard]] StringView asView() const |