diff --git a/src/Exception.hpp b/src/Exception.hpp index 4b7e9f5..1ca025c 100644 --- a/src/Exception.hpp +++ b/src/Exception.hpp @@ -34,7 +34,7 @@ namespace ArbUt { } /// @brief Returns the error message of the exception. - [[nodiscard]] const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW override { + [[nodiscard]] const char* what() const _GLIBCXX_TXN_SAFE_DYN _GLIBCXX_NOTHROW final { return logic_error::what(); } diff --git a/src/String/StringView.hpp b/src/String/StringView.hpp index 81353a7..06a1858 100644 --- a/src/String/StringView.hpp +++ b/src/String/StringView.hpp @@ -115,19 +115,19 @@ namespace ArbUt { /// @brief Returns null-terminated C string. /// @return Null-terminated C string. - [[nodiscard]] inline const char* c_str() const noexcept override { return _str->GetValue(); } + [[nodiscard]] inline const char* c_str() const noexcept final { return _str->GetValue(); } /// @brief Returns std string_view of internal C string. /// @return std::string_view. - [[nodiscard]] inline std::string_view std_str() const noexcept override { return _str->GetValue(); } + [[nodiscard]] inline std::string_view std_str() const noexcept final { return _str->GetValue(); } - inline constexpr bool operator==(const std::string_view& rhs) const noexcept override { + inline constexpr bool operator==(const std::string_view& rhs) const noexcept final { return _hash == Hash(rhs.data()); } - inline constexpr bool operator!=(const std::string_view& rhs) const noexcept override { + inline constexpr bool operator!=(const std::string_view& rhs) const noexcept final { return _hash != Hash(rhs.data()); } - inline constexpr bool operator==(const char* rhs) const noexcept override { return _hash == Hash(rhs); } - inline constexpr bool operator!=(const char* rhs) const noexcept override { return _hash != Hash(rhs); } + inline constexpr bool operator==(const char* rhs) const noexcept final { return _hash == Hash(rhs); } + inline constexpr bool operator!=(const char* rhs) const noexcept final { return _hash != Hash(rhs); } /// @brief Calculates the hash for a given C string. /// @param val A null-terminated C string. diff --git a/src/String/StringViewLiteral.hpp b/src/String/StringViewLiteral.hpp index 29cfeed..28b057d 100644 --- a/src/String/StringViewLiteral.hpp +++ b/src/String/StringViewLiteral.hpp @@ -20,8 +20,8 @@ namespace ArbUt { /// @brief Compile time initialisation of a StringViewLiteral. Length is calculated at compile. /// @param str A null terminated C string. constexpr StringViewLiteral(const char* str) noexcept : StringViewLiteral(str, CalcLength(str)){}; - [[nodiscard]] inline constexpr const char* c_str() const noexcept override { return _str; } - [[nodiscard]] constexpr std::string_view std_str() const noexcept override { + [[nodiscard]] inline constexpr const char* c_str() const noexcept final { return _str; } + [[nodiscard]] constexpr std::string_view std_str() const noexcept final { return std::string_view(_str, _length); } /// @brief Returns the hash of a s.tringview literal. @@ -32,14 +32,14 @@ namespace ArbUt { /// @return A normal StringView. inline operator StringView() const noexcept { return StringView(*this, _str, _length); } - inline constexpr bool operator==(const std::string_view& rhs) const noexcept override { + inline constexpr bool operator==(const std::string_view& rhs) const noexcept final { return _hash == Hash(rhs.data()); } - inline constexpr bool operator!=(const std::string_view& rhs) const noexcept override { + inline constexpr bool operator!=(const std::string_view& rhs) const noexcept final { return _hash != Hash(rhs.data()); } - inline constexpr bool operator==(const char* rhs) const noexcept override { return _hash == Hash(rhs); } - inline constexpr bool operator!=(const char* rhs) const noexcept override { return _hash != Hash(rhs); } + inline constexpr bool operator==(const char* rhs) const noexcept final { return _hash == Hash(rhs); } + inline constexpr bool operator!=(const char* rhs) const noexcept final { return _hash != Hash(rhs); } }; }