Header c_str_view.h
-
template<typename Char>
class basic_c_str_view A string view type for null-terminated strings.
- Template Parameters
Char – The character type
Public Functions
-
inline constexpr const_reference front() const noexcept
Get the first character.
-
inline constexpr size_t size() const noexcept
Get the length of the string, excluding the null terminator
Remark
This function is not \(O(1)\). It calls
strlen
.
-
inline constexpr bool empty() const noexcept
Check if the view is empty.
-
inline constexpr void remove_prefix(const size_t n) noexcept
Remove prefix with a certain length from the view.
-
inline constexpr void swap(basic_c_str_view &other) noexcept
Swap two views.
Friends
- inline friend constexpr friend void swap (basic_c_str_view &lhs, basic_c_str_view &rhs) noexcept
Swap two views.
-
struct sentinel
Sentinel type.