operator-(ranges::enumerate_view::sentinel)
来自cppreference.com
范围库
| ||||||||||||||||||||||
| 范围原语 | |||||||
| |||||||
| 范围概念 | |||||||||||||||||||
| |||||||||||||||||||
| 范围工厂 | |||||||||
| |||||||||
| 范围适配器 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 辅助项 | |||||||||||||||||
|
| ||||||||||||||||
template< bool OtherConst >
requires std::sized_sentinel_for<
ranges::sentinel_t<Base>,
ranges::iterator_t</*或许为 const*/<OtherConst, V>>>
friend constexpr ranges::range_difference_t</*或许为 const*/<OtherConst, V>>
operator-( const /*iterator*/<OtherConst>& x, const /*sentinel*/& y );
|
(1) | (C++23 起) |
template< bool OtherConst >
requires std::sized_sentinel_for<
ranges::sentinel_t<Base>,
ranges::iterator_t</*或许为 const*/<OtherConst, V>>>
friend constexpr ranges::range_difference_t</*或许为 const*/<OtherConst, V>>
operator-( const /*sentinel*/& y, const /*iterator*/<OtherConst>& x );
|
(2) | (C++23 起) |
这些函数模板对常规的无限定或有限定查找不可见,而只能在 enumerate_view::sentinel 为实参的关联类时由实参依赖查找找到。
参数
| x | - | 迭代器 |
| y | - | 哨位 |
返回值
1)
x.base() - y.base()2)
y.base() - x.base()示例
| 本节未完成 原因:暂无示例 |