constexpr basic_string_view() noexcept;
Postconditions:
size_ == 0 and
data_ == nullptr. constexpr basic_string_view(const charT* str);
Preconditions:
[str, str + traits::length(str)) is a valid range
. Effects:
Constructs a
basic_string_view, initializing
data_ with
str
and initializing
size_ with
traits::length(str). Complexity:
O(traits::length(str)). constexpr basic_string_view(const charT* str, size_type len);
Preconditions:
[str, str + len) is a valid range
. Effects:
Constructs a
basic_string_view, initializing
data_ with
str
and initializing
size_ with
len. template<class It, class End>
constexpr basic_string_view(It begin, End end);
Constraints:
- It satisfies contiguous_iterator.
- End satisfies sized_sentinel_for<It>.
- is_same_v<iter_value_t<It>, charT> is true.
- is_convertible_v<End, size_type> is false.
Preconditions:
- [begin, end) is a valid range.
- It models contiguous_iterator.
- End models sized_sentinel_for<It>.
Effects:
Initializes
data_ with
to_address(begin) and
initializes
size_ with
end - begin.