std::experimental::basic_string_view
From cppreference.com
< cpp | experimental
| Defined in header <experimental/string_view>
|
||
template<
class CharT,
class Traits = std::char_traits<CharT>
> class basic_string_view;
|
(library fundamentals TS) | |
The class template basic_string_view describes an object that can refer to a constant contiguous sequence of char-like objects with the first element of the sequence at position zero.
A typical implementation holds only two members: a pointer to constant CharT and a size.
Several typedefs for common character types are provided:
Defined in header
<experimental/string_view> | |
| Type | Definition |
| std::experimental::string_view | std::experimental::basic_string_view<char>
|
| std::experimental::wstring_view | std::experimental::basic_string_view<wchar_t>
|
| std::experimental::u16string_view | std::experimental::basic_string_view<char16_t>
|
| std::experimental::u32string_view | std::experimental::basic_string_view<char32_t>
|
Template parameters
| CharT | - | character type |
| Traits | - | traits class specifying the operations on the character type |
Member types
| Member type | Definition |
traits_type
|
Traits
|
value_type
|
CharT
|
pointer
|
CharT*
|
const_pointer
|
const CharT*
|
reference
|
CharT&
|
const_reference
|
const CharT&
|
const_iterator
|
implementation-defined LegacyRandomAccessIterator |
iterator
|
const_iterator
|
reverse_iterator
|
const_reverse_iterator
|
const_reverse_iterator
|
std::reverse_iterator<const_iterator>
|
size_type
|
std::size_t |
difference_type
|
std::ptrdiff_t |
Note: iterator and const_iterator are the same type because string views are views into constant character sequences.
Member functions
constructs a basic_string_view (public member function) | |
| assigns a view (public member function) | |
Iterators | |
| returns an iterator to the beginning (public member function) | |
| returns an iterator to the end (public member function) | |
| returns a reverse iterator to the beginning (public member function) | |
| returns a reverse iterator to the end (public member function) | |
Element access | |