mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
AK+LibRegex: Disable construction of views from temporary Strings
This commit is contained in:
parent
e606ff3751
commit
e8f6840471
3 changed files with 6 additions and 0 deletions
|
@ -48,6 +48,8 @@ public:
|
||||||
StringView(const String&);
|
StringView(const String&);
|
||||||
StringView(const FlyString&);
|
StringView(const FlyString&);
|
||||||
|
|
||||||
|
explicit StringView(String&&) = delete;
|
||||||
|
|
||||||
[[nodiscard]] constexpr bool is_null() const { return !m_characters; }
|
[[nodiscard]] constexpr bool is_null() const { return !m_characters; }
|
||||||
[[nodiscard]] constexpr bool is_empty() const { return m_length == 0; }
|
[[nodiscard]] constexpr bool is_empty() const { return m_length == 0; }
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,8 @@ public:
|
||||||
explicit Utf8View(const char*);
|
explicit Utf8View(const char*);
|
||||||
~Utf8View() = default;
|
~Utf8View() = default;
|
||||||
|
|
||||||
|
explicit Utf8View(String&&) = delete;
|
||||||
|
|
||||||
const StringView& as_string() const { return m_string; }
|
const StringView& as_string() const { return m_string; }
|
||||||
|
|
||||||
Utf8CodePointIterator begin() const;
|
Utf8CodePointIterator begin() const;
|
||||||
|
|
|
@ -54,6 +54,8 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
explicit RegexStringView(String&&) = delete;
|
||||||
|
|
||||||
StringView const& string_view() const
|
StringView const& string_view() const
|
||||||
{
|
{
|
||||||
return m_view.get<StringView>();
|
return m_view.get<StringView>();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue