std::ranges::safe_iterator_t,std::ranges::safe_subrange_t (3) - Linux Manuals
std::ranges::safe_iterator_t,std::ranges::safe_subrange_t: std::ranges::safe_iterator_t,std::ranges::safe_subrange_t
Command to display std::ranges::safe_iterator_t,std::ranges::safe_subrange_t
manual in Linux: $ man 3 std::ranges::safe_iterator_t,std::ranges::safe_subrange_t
NAME
std::ranges::safe_iterator_t,std::ranges::safe_subrange_t - std::ranges::safe_iterator_t,std::ranges::safe_subrange_t
Synopsis
Defined in header <ranges>
template<Range R>
using safe_iterator_t = std::conditional_t<__ForwardingRange<R>, (1) (since C++20)
ranges::iterator_t<R>, ranges::dangling>;
template<Range R>
using safe_subrange_t = std::conditional_t<__ForwardingRange<R>, (2) (since C++20)
ranges::subrange<ranges::iterator_t<R>>, ranges::dangling>;
1) Same as ranges::iterator_t when R models exposition-only concept __ForwardingRange, otherwise yields ranges::dangling instead.
2) Similar to (1), but it yields a specialization of ranges::subrange when the the same condition is met.
These two alias templates are used by some constrained_algorithms to avoid returning potentially dangling iterators or views.
See also
a placeholder type indicating that an iterator or a subrange should not be returned since it would be dangling
dangling (class)
Pages related to std::ranges::safe_iterator_t,std::ranges::safe_subrange_t
- std::ranges::swap (3) - std::ranges::swap
- std::ranges::BidirectionalRange (3) - std::ranges::BidirectionalRange
- std::ranges::CommonRange (3) - std::ranges::CommonRange
- std::ranges::ContiguousRange (3) - std::ranges::ContiguousRange
- std::ranges::ForwardRange (3) - std::ranges::ForwardRange
- std::ranges::InputRange (3) - std::ranges::InputRange
- std::ranges::OutputRange (3) - std::ranges::OutputRange
- std::ranges::RandomAccessRange (3) - std::ranges::RandomAccessRange
- std::ranges::Range (3) - std::ranges::Range
- std::ranges::SizedRange,std::ranges::disable_sized_range (3) - std::ranges::SizedRange,std::ranges::disable_sized_range
- std::ranges::View,std::ranges::enable_view,std::ranges::view_base (3) - std::ranges::View,std::ranges::enable_view,std::ranges::view_base
- std::ranges::ViewableRange (3) - std::ranges::ViewableRange
- std::ranges::all_of,std::ranges::any_of,std::ranges::none_of (3) - std::ranges::all_of,std::ranges::any_of,std::ranges::none_of
- std::ranges::begin,std::ranges::cbegin (3) - std::ranges::begin,std::ranges::cbegin
- std::ranges::dangling (3) - std::ranges::dangling
- std::ranges::equal_to (3) - std::ranges::equal_to
- std::ranges::greater (3) - std::ranges::greater