• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

    最終更新日時(UTC):
    が更新

    履歴 編集

    function
    <flat_set>

    std::flat_multiset::end

    iterator end() noexcept;
    const_iterator end() const noexcept;
    

    概要

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

    戻り値

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

    計算量

    定数時間。

    備考

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

    #include <flat_set>
    #include <iostream>
    
    int main()
    {
      std::flat_multiset<int> fs = {3, 1, 4, 1};
    
      for (auto i = fs.begin(); i != fs.end(); ++i) {
        std::cout << *i << std::endl;
      }
    }
    

    出力

    1
    1
    3
    4
    

    バージョン

    言語

    • C++23

    処理系

    関連項目

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