Remove constevals for now, until mingw32-w64 supports it on the build server.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-09-24 20:54:11 +02:00
parent 9d7b2d62b6
commit 2e93cd65c5
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 6 additions and 6 deletions

View File

@ -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);
}