Skip to content

Latest commit

 

History

History
55 lines (45 loc) · 986 Bytes

File metadata and controls

55 lines (45 loc) · 986 Bytes

end

  • ranges[meta header]
  • std::ranges[meta namespace]
  • subrange[meta class]
  • function[meta id-type]
  • cpp20[meta cpp]
constexpr S end() const;

概要

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

効果

return end_;

ただし、end_subrangeが内部で保持する番兵。

#include <ranges>
#include <iostream>

int main()
{
  constexpr int a[] = {1, 2, 3};
  const std::ranges::subrange sub(a);
  // .begin と .end を暗黙的に使用
  for (int x : sub) {
    std::cout << x << '\n';
  }
}

出力

1
2
3

バージョン

言語

  • C++20

処理系

参照