util/TemplateString: add StringView cast operator
This commit is contained in:
parent
ad2c22844c
commit
618f94f589
|
@ -30,6 +30,8 @@
|
||||||
#ifndef TEMPLATE_STRING_HXX
|
#ifndef TEMPLATE_STRING_HXX
|
||||||
#define TEMPLATE_STRING_HXX
|
#define TEMPLATE_STRING_HXX
|
||||||
|
|
||||||
|
#include "StringView.hxx"
|
||||||
|
|
||||||
#include <array> // for std::size()
|
#include <array> // for std::size()
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
@ -48,6 +50,10 @@ struct Buffer {
|
||||||
constexpr operator std::string_view() const noexcept {
|
constexpr operator std::string_view() const noexcept {
|
||||||
return {value, size};
|
return {value, size};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr operator StringView() const noexcept {
|
||||||
|
return {value, size};
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue