nothrow-input-range, nothrow-forward-range, nothrow-bidirectional-range, no-throw-input-range, nothrow-random-access-range, nothrow-sized-random-access-range
De fr.cppreference.net
template< class R >
concept /*nothrow-input-range*/ =
ranges::range<R> &&
/*nothrow-input-iterator*/<ranges::iterator_t<R>> &&
/*nothrow-sentinel-for*/<ranges::sentinel_t<R>, ranges::iterator_t<R>>;
|
(1) | (exposition uniquement*) |
template< class R >
concept /*nothrow-forward-range*/ =
/*nothrow-input-range*/<R> &&
/*nothrow-forward-iterator*/<ranges::iterator_t<R>>;
|
(2) | (exposition uniquement*) |
template< class R >
concept /*nothrow-bidirectional-range*/ =
/*nothrow-forward-range*/<R> &&
/*nothrow-bidirectional-iterator*/<ranges::iterator_t<R>>;
|
(3) | (depuis C++26) (exposition uniquement*) |
template< class R >
concept /*nothrow-random-access-range*/ =
/*nothrow-bidirectional-range*/<R> &&
/*nothrow-random-access-iterator*/<ranges::iterator_t<R>>;
|
(4) | (depuis C++26) (exposition uniquement*) |
template< class R >
concept /*nothrow-sized-random-access-range*/ =
/*nothrow-random-access-range*/<R> && ranges::sized_range<R>;
|
(5) | (depuis C++26) (exposition uniquement*) |
Ces concepts d'exposition uniquement spécifient qu'aucune exception n'est levée par les opérations requises par les algorithmes <mémoire> spécialisés sur les ranges.
Pour les définitions de /*nothrow-input-iterator*/, /*nothrow-forward-iterator*/, /*nothrow-bidirectional-iterator*/ et /*nothrow-random-access-iterator*/, voir cette page.
Exigences sémantiques
1) Un type
R modélise nothrow-input-range seulement si aucune exception n'est levée lors des appels à ranges::begin et ranges::end sur un objet de type R.5) Un type
R modélise nothrow-sized-random-access-range seulement si aucune exception n'est levée lors des appels à ranges::size sur un objet de type R.Notes
Ces concepts permettent à certaines opérations sur les ranges de lever des exceptions.
Voir aussi
(C++20) |
spécifie qu'un type est un range, c'est-à-dire qu'il fournit un begin itérateur et un end sentinelle (concept) |
(C++20) |
spécifie qu'un range connaît sa taille en temps constant (concept) |
(C++20)(C++23)(C++20)(C++23) |
obtient les types d'itérateur et de sentinelle d'un range (alias de modèle) |