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 99405a4c93
commit 67760f5283
1 changed files with 3 additions and 1 deletions

View File

@ -125,7 +125,9 @@ public:
}
operator string_view() const noexcept {
return value;
return value != nullptr
? string_view(value)
: string_view();
}
constexpr const_pointer c_str() const noexcept {