[ox/std] Fix BString == and != operators
This commit is contained in:
parent
54eebf81da
commit
6d4c57d37d
22
deps/ox/src/ox/std/bstring.hpp
vendored
22
deps/ox/src/ox/std/bstring.hpp
vendored
@ -48,9 +48,13 @@ class BString {
|
||||
|
||||
constexpr BString operator+(Integer_c auto i) const noexcept;
|
||||
|
||||
constexpr bool operator==(const BString &other) const noexcept;
|
||||
constexpr bool operator==(const char *other) const noexcept;
|
||||
|
||||
constexpr bool operator!=(const BString &other) noexcept;
|
||||
constexpr bool operator==(const OxString_c auto &other) const noexcept;
|
||||
|
||||
constexpr bool operator!=(const char *other) const noexcept;
|
||||
|
||||
constexpr bool operator!=(const OxString_c auto &other) noexcept;
|
||||
|
||||
constexpr char operator[](std::size_t i) const noexcept;
|
||||
|
||||
@ -167,12 +171,22 @@ constexpr BString<size> BString<size>::operator+(Integer_c auto i) const noexcep
|
||||
}
|
||||
|
||||
template<std::size_t buffLen>
|
||||
constexpr bool BString<buffLen>::operator==(const BString<buffLen> &other) const noexcept {
|
||||
constexpr bool BString<buffLen>::operator==(const char *other) const noexcept {
|
||||
return ox::StringView(*this) == other;
|
||||
}
|
||||
|
||||
template<std::size_t buffLen>
|
||||
constexpr bool BString<buffLen>::operator==(const OxString_c auto &other) const noexcept {
|
||||
return ox::StringView(*this) == ox::StringView(other);
|
||||
}
|
||||
|
||||
template<std::size_t buffLen>
|
||||
constexpr bool BString<buffLen>::operator!=(const BString<buffLen> &other) noexcept {
|
||||
constexpr bool BString<buffLen>::operator!=(const char *other) const noexcept {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
template<std::size_t buffLen>
|
||||
constexpr bool BString<buffLen>::operator!=(const OxString_c auto &other) noexcept {
|
||||
return !operator==(other);
|
||||
}
|
||||
|
||||
|
2
deps/ox/src/ox/std/test/tests.cpp
vendored
2
deps/ox/src/ox/std/test/tests.cpp
vendored
@ -206,7 +206,7 @@ static std::map<ox::String, ox::Error(*)()> tests = {
|
||||
[] {
|
||||
constexpr ox::StringView uuidStr = "8d814442-f46e-4cc3-8edc-ca3c01cc86db";
|
||||
oxRequire(uuid, ox::UUID::fromString(uuidStr));
|
||||
oxExpect(ox::StringView(uuid.toString()), uuidStr);
|
||||
oxExpect(uuid.toString(), uuidStr);
|
||||
return OxError(0);
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user