std::basic_string_view<CharT,Traits>::operator=
提供: cppreference.com
<tbody>
</tbody>
constexpr basic_string_view& operator=( const basic_string_view& view ) noexcept = default; |
(C++17以上) | |
ビューを view と置き換えます。
引数
| view | - | コピーするビュー |
戻り値
*this。
計算量
一定。
例
Run this code
#include <iostream>
#include <string_view>
int main()
{
std::string_view v = "Hello, world";
v = v.substr(7);
std::cout << v << '\n';
}
出力:
world
関連項目
basic_string_view を構築します (パブリックメンバ関数) |