21 Strings library [strings]

21.4 String view classes [string.view]

21.4.2 Class template basic_­string_­view [string.view.template]

21.4.2.1 Construction and assignment [string.view.cons]

constexpr basic_string_view() noexcept;
Ensures: size_­ == 0 and data_­ == nullptr.
constexpr basic_string_view(const charT* str);
Expects: [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: .
constexpr basic_string_view(const charT* str, size_type len);
Expects: [str, str + len) is a valid range.
Effects: Constructs a basic_­string_­view, initializing data_­ with str and initializing size_­ with len.