◐ Shell
clean mode source ↗

std::basic_string_view<CharT,Traits>::operator= - cppreference.com

De cppreference.com

constexpr basic_string_view& operator=( const basic_string_view& view ) noexcept = default;

(desde C++17)

Reemplaza la vista con la vista de view.

Parámetros

Valor de retorno

*this

Complejidad

Constante.

Ejemplo

#include <iostream>
#include <string_view>
int main()
{
    std::string_view v = "Hola, mundo";
    v = v.substr(6);
    std::cout << v << '\n';
}

Salida:

Véase también