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

履歴 編集

variable
<iterator>

std::disable_sized_sentinel_for(C++20)

namespace std {
  template<class S, class I>
  inline constexpr bool disable_sized_sentinel_for = false;

  // reverse_iteratorに対する特殊化
  template<class Iterator1, class Iterator2>
    requires (!sized_sentinel_for<Iterator1, Iterator2>)
  inline constexpr bool disable_sized_sentinel_for<reverse_iterator<Iterator1>,
                                                   reverse_iterator<Iterator2>> = true;
}

概要

disable_sized_sentinel_forは、任意のイテレータ型Iとその番兵型Sについてsized_sentinel_forを無効化するカスタマイゼーションポイントである。

イテレータ型I, Ssized_sentinel_forを満たすがそのモデルとならない(意味論的な要件まで満足することができない)ようなイテレータをライブラリで使用するためのopt-outメカニズムとして提供されている。

要件

I, Sプログラム定義型である場合に、非配列型かつオブジェクト型であるI, Sに対して特殊化が許可される。
そのような特殊化は定数式で使用可能であり、const bool型を持つ必要がある。

sized_sentinel_forのサンプルコードを参照。

バージョン

言語

  • C++20

処理系

関連項目

参照