The Wayback Machine - https://web.archive.org/web/20180513115904/http://ja.cppreference.com:80/w/cpp/string/basic_string/end
名前空間
変種
操作

std::basic_string::end, std::basic_string::cend

提供: cppreference.com
< cpp‎ | string‎ | basic string
 
 
 
std::basic_string
 
iterator end();
const_iterator end()const;
const_iterator cend()const;
(C++11およびそれ以降)

文字列の最後の文字の次の文字を指すイテレータを返します。 この文字はプレースホルダの役割を持ちます。 この文字にアクセスを試みると未定義動作になります。

range-begin-end.svg

目次

[編集]引数

(なし)

[編集]戻り値

最後の文字の次の文字を指すイテレータ。

[編集]例外

(なし)(C++11以前)
noexcept 指定:  
noexcept
  
(C++11およびそれ以降)

[編集]計算量

一定。

[編集]

#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

[編集]関連項目

先頭を指すイテレータを返します
(パブリックメンバ関数)[edit]
close