[ox/std] Add CStringView::CStringView(StringLiteral)

This commit is contained in:
Gary Talent 2023-12-03 19:06:37 -06:00
parent 9ab3543b32
commit 8f5173e52a

View File

@ -8,13 +8,10 @@
#pragma once #pragma once
#ifdef OX_USE_STDLIB
#include <string_view>
#endif
#include "basestringview.hpp" #include "basestringview.hpp"
#include "bstring.hpp" #include "bstring.hpp"
#include "string.hpp" #include "string.hpp"
#include "stringliteral.hpp"
namespace ox { namespace ox {
@ -24,6 +21,8 @@ class CStringView: public detail::BaseStringView {
constexpr CStringView(CStringView const&sv) noexcept = default; constexpr CStringView(CStringView const&sv) noexcept = default;
constexpr CStringView(StringLiteral const&str) noexcept: BaseStringView(str.data(), str.len()) {}
template<std::size_t SmallStrSz> template<std::size_t SmallStrSz>
constexpr CStringView(BasicString<SmallStrSz> const&str) noexcept: BaseStringView(str.data(), str.len()) {} constexpr CStringView(BasicString<SmallStrSz> const&str) noexcept: BaseStringView(str.data(), str.len()) {}