Common functionality for string views

Synopsis

class string_view_base;

Types

Name

Description

const_iterator

The const iterator type

const_pointer

The const pointer type

const_reference

The const reference type

const_reverse_iterator

The const reverse iterator type

difference_type

The difference type

iterator

The iterator type

pointer

The pointer type

reference

The reference type

reverse_iterator

The reverse iterator type

size_type

The size type

traits_type

The character traits

value_type

The value type

Member Functions

Name

Description

at

Access a character

back

Return the last character

begin

Return an iterator to the beginning

cbegin

Return an iterator to the beginning

cend

Return an iterator to the end

compare

Return the result of comparing to another string

contains

Return true if matching characters are found

copy

Copy the characters to another buffer

crbegin

crend

data

Return a pointer to the character buffer

empty

Return true if the string is empty

end

Return an iterator to the end

ends_with

Return true if a matching suffix exists

find

Return the position of matching characters

find_first_not_of

Return the position of the first non-match

find_first_of

Return the position of the first match

find_last_not_of

Return the position of the last non-match

find_last_of

Return the position of the last match

front

Return the first character

length

Return the size

max_size

Return the maximum allowed size

operator core::string_view

Conversion

operator std::string

Conversion

operator[]

Access a character

rbegin

rend

rfind

Return the position of matching characters

size

Return the size

starts_with

Return true if a matching prefix exists

substr

Return a view to part of the string

Static Data Members

Name

Description

npos

A constant used to represent "no position"

Friends

Name

Description

hash_value

Return the hash of this value

operator!=

operator<

operator<<

operator⇐

operator==

operator>

operator>=

Description

This base class is used to provide common member functions for reference types that behave like string views. This cannot be instantiated directly; Instead, derive from the type and provide constructors which offer any desired preconditions and invariants.