Commit 36168a24 authored by Max Kellermann's avatar Max Kellermann Committed by Max Kellermann

util/AllocatedString: support casting a nulled instance to string_view

parent 5e67443a
...@@ -125,7 +125,9 @@ public: ...@@ -125,7 +125,9 @@ public:
} }
operator string_view() const noexcept { operator string_view() const noexcept {
return value; return value != nullptr
? string_view(value)
: string_view();
} }
constexpr const_pointer c_str() const noexcept { constexpr const_pointer c_str() const noexcept {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment