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

履歴 編集

function
<inplace_vector>

std::inplace_vector::end(C++26)

constexpr iterator end() noexcept;             // (1) C++26
constexpr const_iterator end() const noexcept; // (2) C++26

概要

末尾の次を指すイテレータを取得する。

  • (1) : 非constな文脈で末尾の次を指すイテレータを取得する。
  • (2) : constな文脈で末尾の次を指す読み取り専用イテレータを取得する。

戻り値

constな文脈ではiterator型で末尾の次を指すイテレータを返し、 constな文脈ではconst_iterator型で末尾の次を指すイテレータを返す。

例外

投げない

計算量

定数時間

#include <print>
#include <inplace_vector>

int main()
{
  std::inplace_vector<int, 5> iv = {1, 2, 3};

  for (auto i = iv.begin(); i != iv.end(); ++i) {
    std::println("{}", *i);
  }
}

出力

1
2
3

バージョン

言語

  • C++26

処理系

参照