std::experimental::basic_string_view<CharT,Traits>::operator=
來自 cppreference.com
< 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 (公有成員函式) |