summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2018-08-20 15:34:07 +0200
committerMax Kellermann <max@musicpd.org>2018-08-20 15:34:07 +0200
commitfe6de14faf759f422760bfa0ae7b3c7b95bad9d3 (patch)
tree94804ff27a6bf2466fdd55558f4d3a7e63447408 /src
parente85b9960f0b53274cf5116e0fd339758d2614ccc (diff)
util/StringView: add ConstBuffer cast constructors
Diffstat (limited to 'src')
-rw-r--r--src/util/StringView.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/StringView.hxx b/src/util/StringView.hxx
index 0bc8cdfab..714271de0 100644
--- a/src/util/StringView.hxx
+++ b/src/util/StringView.hxx
@@ -44,6 +44,12 @@ struct BasicStringView : ConstBuffer<T> {
BasicStringView() = default;
+ explicit constexpr BasicStringView(ConstBuffer<T> src)
+ :ConstBuffer<T>(src) {}
+
+ explicit constexpr BasicStringView(ConstBuffer<void> src)
+ :ConstBuffer<T>(ConstBuffer<T>::FromVoid(src)) {}
+
constexpr BasicStringView(pointer_type _data, size_type _size) noexcept
:ConstBuffer<T>(_data, _size) {}