From fe6de14faf759f422760bfa0ae7b3c7b95bad9d3 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Aug 2018 15:34:07 +0200 Subject: [PATCH] util/StringView: add ConstBuffer cast constructors --- src/util/StringView.hxx | 6 ++++++ 1 file changed, 6 insertions(+) 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 { BasicStringView() = default; + explicit constexpr BasicStringView(ConstBuffer src) + :ConstBuffer(src) {} + + explicit constexpr BasicStringView(ConstBuffer src) + :ConstBuffer(ConstBuffer::FromVoid(src)) {} + constexpr BasicStringView(pointer_type _data, size_type _size) noexcept :ConstBuffer(_data, _size) {}