diff --git a/deps/ox/src/ox/std/bstring.hpp b/deps/ox/src/ox/std/bstring.hpp index 7997ba8f..c591e852 100644 --- a/deps/ox/src/ox/std/bstring.hpp +++ b/deps/ox/src/ox/std/bstring.hpp @@ -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 BString::operator+(Integer_c auto i) const noexcep } template -constexpr bool BString::operator==(const BString &other) const noexcept { +constexpr bool BString::operator==(const char *other) const noexcept { + return ox::StringView(*this) == other; +} + +template +constexpr bool BString::operator==(const OxString_c auto &other) const noexcept { return ox::StringView(*this) == ox::StringView(other); } template -constexpr bool BString::operator!=(const BString &other) noexcept { +constexpr bool BString::operator!=(const char *other) const noexcept { + return !operator==(other); +} + +template +constexpr bool BString::operator!=(const OxString_c auto &other) noexcept { return !operator==(other); } diff --git a/deps/ox/src/ox/std/test/tests.cpp b/deps/ox/src/ox/std/test/tests.cpp index 96af15a2..61f2ec5c 100644 --- a/deps/ox/src/ox/std/test/tests.cpp +++ b/deps/ox/src/ox/std/test/tests.cpp @@ -206,7 +206,7 @@ static std::map 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); } },