diff --git a/src/String/StringViewLiteral.hpp b/src/String/StringViewLiteral.hpp index d2ae427..5a1bdc9 100644 --- a/src/String/StringViewLiteral.hpp +++ b/src/String/StringViewLiteral.hpp @@ -16,11 +16,11 @@ namespace ArbUt { /// @brief Compile time initialisation of a StringViewLiteral. /// @param str A null terminated C string. /// @param size A The length of the string. - consteval StringViewLiteral(const char* str, size_t size) noexcept + constexpr StringViewLiteral(const char* str, size_t size) noexcept : BasicStringView(size, Hash(str)), _str(str) {} /// @brief Compile time initialisation of a StringViewLiteral. Length is calculated at compile. /// @param str A null terminated C string. - consteval StringViewLiteral(const char* str) noexcept : StringViewLiteral(str, CalcLength(str)){}; + 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 { return std::string_view(_str, _length); @@ -28,7 +28,7 @@ namespace ArbUt { /// @brief Returns the hash of a s.tringview literal. /// @param s A stringview literal. /// @return The hash of the stringview literal. - consteval std::size_t operator()(StringViewLiteral const& s) const noexcept { return s.GetHash(); } + constexpr std::size_t operator()(StringViewLiteral const& s) const noexcept { return s.GetHash(); } /// @brief Converts stringview literal into non-literal (for use during runtime). /// @return A normal StringView. inline operator StringView() const noexcept { return StringView(*this, _str, _length); } @@ -50,14 +50,14 @@ namespace std { /// @brief Returns the hash of a stringview. /// @param s a StringView. /// @return The hash of the StringView. - consteval std::size_t operator()(ArbUt::StringViewLiteral const& s) const noexcept { return s.GetHash(); } + constexpr std::size_t operator()(ArbUt::StringViewLiteral const& s) const noexcept { return s.GetHash(); } }; } -inline consteval ArbUt::StringViewLiteral operator"" _const_nocase(const char* c, size_t l) { +inline constexpr ArbUt::StringViewLiteral operator"" _const_nocase(const char* c, size_t l) { return ArbUt::StringViewLiteral(c, l); } -inline consteval ArbUt::StringViewLiteral operator"" _cnc(const char* c, size_t l) { +inline constexpr ArbUt::StringViewLiteral operator"" _cnc(const char* c, size_t l) { return ArbUt::StringViewLiteral(c, l); }