Skip to content

Files

Latest commit

9ee90cb · Jan 30, 2025

History

History
82 lines (64 loc) · 2.14 KB

File metadata and controls

82 lines (64 loc) · 2.14 KB

end

  • flat_map[meta header]
  • std[meta namespace]
  • flat_multimap[meta class]
  • function[meta id-type]
  • cpp23[meta cpp]
iterator end() noexcept;
const_iterator end() const noexcept;

概要

コンテナの末尾の次を参照するイテレータを取得する。

戻り値

コンテナの最後の要素の次を参照するイテレータ。 iteratorconst_iterator はいずれもメンバ型である。flat_multimap クラステンプレートにおいて、これらはランダムアクセスイテレータである。

計算量

定数時間

備考

  • この関数によって返されるイテレータは、*thisが保持するいずれの要素も参照しない。その指す先は、不正な範囲となるだろう

#include <flat_map>
#include <iostream>

int main()
{
  std::flat_multimap<int, char> fm = {
    {10, 'A'}, {11, 'B'}, {12, 'C'},
    {10, 'a'}, {11, 'b'}, {12, 'c'},
  };

  for (auto i = fm.begin(); i != fm.end(); ++i) {
      std::cout << i->first << " " << i->second << "\n";
  }
}
  • end()[color ff0000]
  • fm.begin()[link begin.md]

出力

1 A
2 B
3 C
4 D
5 E
6 F
7 G
8 H

バージョン

言語

  • C++23

処理系

関連項目

名前 説明
flat_multimap::begin 先頭を指すイテレータを取得する
flat_multimap::cbegin 先頭を指すconstイテレータを取得する
flat_multimap::cend 末尾の次を指すconstイテレータを取得する
flat_multimap::rbegin 末尾の次を指す逆イテレータを取得する
flat_multimap::rend 先頭の前を指す逆イテレータを取得する
flat_multimap::crbegin 末尾を指す逆constイテレータを取得する
flat_multimap::crend 先頭の前を指す逆constイテレータを取得する