std::experimental::basic_string_view<CharT,Traits>::operator=
来自 cppreference.cn
< cpp | experimental | basic string view
basic_string_view& operator=( const basic_string_view& view ) noexcept = default; |
(库基础 TS) | |
将当前视图替换为 view
的视图。
目录 |
[编辑] 参数
view | - | 要复制的视图 |
[编辑] 返回值
*this
[编辑] 复杂度
常数时间。
[编辑] 示例
运行此代码
#include <iostream> #include <experimental/string_view> int main() { std::experimental::string_view v = "Hello, world"; v = v.substr(7); std::cout << v << '\n'; }
输出
world
[编辑] 参阅
构造 basic_string_view (公有成员函数) |