diff --git a/deps/ox/src/ox/std/stringview.hpp b/deps/ox/src/ox/std/stringview.hpp index 2c819b50..3a2ed0a0 100644 --- a/deps/ox/src/ox/std/stringview.hpp +++ b/deps/ox/src/ox/std/stringview.hpp @@ -8,6 +8,10 @@ #pragma once +#ifdef OX_USE_STDLIB +#include +#endif + #include "iterator.hpp" #include "strops.hpp" #include "types.hpp" @@ -264,6 +268,12 @@ constexpr bool endsWith(CRStringView base, CRStringView ending) noexcept { return base.len() >= endingLen && ox_strcmp(base.data() + (base.len() - endingLen), ending) == 0; } +#ifdef OX_USE_STDLIB +constexpr auto toStdStringView(CRStringView sv) noexcept { + return std::string_view(sv.data(), sv.bytes()); +} +#endif + static_assert(StringView("Read").bytes() == 4); static_assert(StringView("Read") == StringView("Read")); static_assert(StringView("Read") != StringView("Write"));