std::basic_spanbuf<CharT,Traits>::span
來自 cppreference.com
< cpp | io | basic spanbuf
std::span<CharT> span() const noexcept; |
(1) | (C++23 起) |
void span( std::span<CharT> s ) noexcept; |
(2) | (C++23 起) |
2) 使
basic_spanbuf
對 s
引用的緩衝區執行 I/O。設定用於獲取區域、放置區域或兩者兼有的指標。在開啟模式中設定的位 (影響獲取區域的指標) |
設定後的返回值 | ||
---|---|---|---|
eback() | gptr() | egptr() | |
std::ios_base::in | s.data() | s.data() | s.data() + s.size() |
在開啟模式中設定的位 (影響放置區域的指標) |
設定後的返回值 | ||
pbase() | pptr() | epptr() | |
std::ios_base::out && !std::ios_base::ate | s.data() | s.data() | s.data() + s.size() |
std::ios_base::out && std::ios_base::ate | s.data() | s.data() + s.size() | s.data() + s.size() |
目錄 |
[edit] 引數
s | - | 引用使用者提供的緩衝區的 std::span |
[edit] 返回值
1) 如果在開啟模式中設定了 std::ios_base::out,則返回 std::span<CharT>(pbase(), pptr());否則,返回引用整個底層緩衝區的 std::span<CharT>。
2) (無)
[edit] 示例
本節不完整 原因:無示例 |
[edit] 參閱
替換或獲取關聯字元字串的副本 ( std::basic_stringbuf<CharT,Traits,Allocator> 的公開成員函式) | |
(C++20) |
獲取底層字元序列的檢視 ( std::basic_stringbuf<CharT,Traits,Allocator> 的公開成員函式) |
將緩衝區標記為凍結並返回輸入序列的起始指標 ( std::strstreambuf 的公開成員函式) |