std::ranges::safe_iterator_t, std::ranges::safe_subrange_t
来自cppreference.com
定义于头文件 <ranges>
|
||
template<ranges::range R> using safe_iterator_t = std::conditional_t<__ForwardingRange<R>, |
(1) | (C++20 起) |
template<ranges::range R> using safe_subrange_t = std::conditional_t<__ForwardingRange<R>, |
(2) | (C++20 起) |
某些有制约算法用此二模板别名避免返回潜在悬垂的迭代器或视图。
参阅
占位类型,指示不应返回迭代器或子范围,因为它可能悬垂 (类) |