std::basic_string_view<CharT,Traits>::end, std::basic_string_view<CharT,Traits>::cend
提供: cppreference.com
< cpp | string | basic string view
constexpr const_iterator end() const noexcept; |
(C++17以上) | |
constexpr const_iterator cend() const noexcept; |
(C++17以上) | |
ビューの最後の文字の次の文字を指すイテレータを返します。 この文字はプレースホルダの役割を持ちます。 この文字にアクセスを試みると未定義動作になります。
目次 |
[編集] 引数
(なし)
[編集] 戻り値
最後の文字の次の文字を指す const_iterator
。
[編集] 計算量
一定。
[編集] 例
Run this code
#include <iostream> #include <iterator> #include <string_view> int main() { std::string_view str_view("abcd"); auto end = str_view.end(); auto cend = str_view.cend(); std::cout << *std::prev(end) << '\n'; std::cout << *std::prev(cend) << '\n'; std::cout << std::boolalpha << (end == cend) << '\n'; }
出力:
d d true
[編集] 関連項目
先頭を指すイテレータを返します (パブリックメンバ関数) |