util/AllocatedString: support casting a nulled instance to string_view

This commit is contained in:
Max Kellermann 2021-01-18 22:32:29 +01:00 committed by Max Kellermann
parent 5e67443a1a
commit 36168a24f5

View File

@ -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 {