From 80ce8b0a1f1e4dc8f67f2c07dab252353ba6593a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 3 Dec 2023 19:06:37 -0600 Subject: [PATCH] [ox/std] Add CStringView::CStringView(StringLiteral) (synced from 8f5173e52a6ac7d8e4e8e45ae526222021acba7f) --- src/ox/std/cstringview.hpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ox/std/cstringview.hpp b/src/ox/std/cstringview.hpp index 7abd7e985..75ed81d59 100644 --- a/src/ox/std/cstringview.hpp +++ b/src/ox/std/cstringview.hpp @@ -8,13 +8,10 @@ #pragma once -#ifdef OX_USE_STDLIB -#include -#endif - #include "basestringview.hpp" #include "bstring.hpp" #include "string.hpp" +#include "stringliteral.hpp" namespace ox { @@ -24,6 +21,8 @@ class CStringView: public detail::BaseStringView { constexpr CStringView(CStringView const&sv) noexcept = default; + constexpr CStringView(StringLiteral const&str) noexcept: BaseStringView(str.data(), str.len()) {} + template constexpr CStringView(BasicString const&str) noexcept: BaseStringView(str.data(), str.len()) {}