std::basic_string::end, std::basic_string::cend
提供: cppreference.com
< cpp | string | basic string
iterator end(); | ||
const_iterator end()const; | ||
const_iterator cend()const; | (C++11およびそれ以降) | |
文字列の最後の文字の次の文字を指すイテレータを返します。 この文字はプレースホルダの役割を持ちます。 この文字にアクセスを試みると未定義動作になります。
目次 |
[編集]引数
(なし)
[編集]戻り値
最後の文字の次の文字を指すイテレータ。
[編集]例外
(なし) | (C++11以前) |
noexcept 指定: noexcept | (C++11およびそれ以降) |
[編集]計算量
一定。
[編集]例
Run this code
#include <iostream>#include <algorithm>#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) | 先頭を指すイテレータを返します (パブリックメンバ関数) |