diff options
author | Max Kellermann <max@musicpd.org> | 2018-08-20 15:34:07 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-08-20 15:34:07 +0200 |
commit | fe6de14faf759f422760bfa0ae7b3c7b95bad9d3 (patch) | |
tree | 94804ff27a6bf2466fdd55558f4d3a7e63447408 /src | |
parent | e85b9960f0b53274cf5116e0fd339758d2614ccc (diff) |
util/StringView: add ConstBuffer cast constructors
Diffstat (limited to 'src')
-rw-r--r-- | src/util/StringView.hxx | 6 |
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) {} |