util/TemplateString: add StringView cast operator

This commit is contained in:
Max Kellermann 2020-10-23 13:11:16 +02:00 committed by Max Kellermann
parent ad2c22844c
commit 618f94f589
1 changed files with 6 additions and 0 deletions

View File

@ -30,6 +30,8 @@
#ifndef TEMPLATE_STRING_HXX
#define TEMPLATE_STRING_HXX
#include "StringView.hxx"
#include <array> // for std::size()
#include <cstddef>
#include <string_view>
@ -48,6 +50,10 @@ struct Buffer {
constexpr operator std::string_view() const noexcept {
return {value, size};
}
constexpr operator StringView() const noexcept {
return {value, size};
}
};
/**