std::basic_string<CharT,Traits,Allocator>:: end, std::basic_string<CharT,Traits,Allocator>:: cend
From cppreference.net
<
cpp
|
string
|
basic string
C++
Strings library
| Classes | ||||
|
(C++17)
|
||||
std::basic_string
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
iterator end
(
)
;
|
(1) |
(C++11以降 noexcept)
(C++20以降 constexpr) |
|
const_iterator end
(
)
const
;
|
(2) |
(C++11以降 noexcept)
(C++20以降 constexpr) |
|
const_iterator cend
(
)
const
noexcept
;
|
(3) |
(C++11以降)
(C++20以降 constexpr) |
文字列の最後の文字の次の文字を指すイテレータを返します。この文字はプレースホルダとして機能し、アクセスを試みると未定義動作が発生します。
目次 |
パラメータ
(なし)
戻り値
最後の文字の次の文字へのイテレータ。
計算量
定数。
注記
libc++はC++98モードに
cend()
をバックポートします。
例
このコードを実行
#include <algorithm> #include <iostream> #include <iterator> #include <string> int main() { std::string s("Exemparl"); std::next_permutation(s.begin(), s.end()); std::string c; std::copy(s.cbegin(), s.cend(), std::back_inserter(c)); std::cout << c << '\n'; // "Exemplar" }
出力:
Exemplar
関連項目
|
(C++11)
|
先頭へのイテレータを返す
(公開メンバ関数) |
|
終端へのイテレータを返す
(
std::basic_string_view<CharT,Traits>
の公開メンバ関数)
|