no-throw-input-iterator, no-throw-forward-iterator, no-throw-sentinel-for, no-throw-input-range, no-throw-forward-range
來自 cppreference.com
template< class I > concept no-throw-input-iterator = |
(1) | (僅作說明*) |
template< class I > concept no-throw-forward-iterator = |
(2) | (僅作說明*) |
template< class S, class I > concept no-throw-sentinel-for = std::sentinel_for<S, I>; |
(3) | (僅作說明*) |
template< class R > concept no-throw-input-range = |
(4) | (僅作說明*) |
template< class R > concept no-throw-forward-range = |
(5) | (僅作說明*) |
這些僅用於解釋的概念指定了迭代器、哨兵和範圍上的演算法所需的操作不會丟擲異常。
[編輯] 語義要求
與所有標準概念一樣,此處列出的每個概念僅在其所有子概念都被建模時才被建模。
1) 型別
I
僅當透過有效迭代器進行遞增、複製構造、移動構造、複製賦值、移動賦值或解引用操作不丟擲異常時,才建模 no-throw-input-iterator
。3) 型別
S
和 I
僅當透過型別 I
和 S
的有效值之間的複製構造、移動構造、複製賦值、移動賦值或比較不丟擲異常時,才建模 no-throw-sentinel-for
。[編輯] 注意
這些概念允許對迭代器和哨兵進行某些操作丟擲異常,例如對無效值的操作。
[編輯] 參閱
(C++20) |
指定型別是一個輸入迭代器,即其引用的值可讀,並且可以進行前置和後置增量 (概念) |
(C++20) |
指定input_iterator 是前向迭代器,支援相等比較和多趟遍歷(概念) |
(C++20) |
指定型別是input_or_output_iterator 型別的哨兵(概念) |
(C++20) |
指定其迭代器型別滿足 input_iterator 的範圍(概念) |
(C++20) |
指定其迭代器型別滿足 forward_iterator 的範圍(概念) |