diff --git a/ostd/string.hh b/ostd/string.hh index c86ef8e..bf21421 100644 --- a/ostd/string.hh +++ b/ostd/string.hh @@ -126,6 +126,14 @@ public: p_beg(v.p_beg), p_end(v.p_end) {} + /** @brief Slices can be constructed from string views. */ + template + basic_char_range(std::basic_string_view< + std::remove_const_t, U + > const &v) noexcept: + p_beg{v.data()}, p_end{v.data() + v.size()} + {} + /** @brief Constructs a slice from a pointer or a static array. * * This constructor handles two cases. The input must be convertible