std::experimental::ranges:: lexicographical_compare
|
template
<
InputIterator I1, Sentinel
<
I1
>
S1, InputIterator I2, Sentinel
<
I2
>
S2,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
,
|
(1) | (ranges TS) |
|
template
<
InputRange R1, InputRange R2,
class
Proj1
=
ranges::
identity
,
class
Proj2
=
ranges::
identity
,
|
(2) | (ranges TS) |
[
first1
,
last1
)
是否在字典序上
小于
第二个范围
[
first2
,
last2
)
。元素分别通过投影函数
proj1
和
proj2
处理后,使用给定的二元比较函数
comp
进行比较。
字典序比较是一种具有以下特性的操作:
- 两个范围按元素逐个比较。
- 第一个不匹配的元素决定了哪个范围在字典序上更 小 或更 大 。
- 如果一个范围是另一个的前缀,则较短的范围在字典序上更 小 。
- 如果两个范围具有等效元素且长度相同,则这两个范围在字典序上 相等 。
- 空范围在字典序上比任何非空范围都 小 。
- 两个空范围在字典序上 相等 。
目录参数
返回值true 如果第一个范围在字典序上 小于 第二个范围。 复杂度最多 2·min(N1, N2) 次比较操作的应用,其中 N1 = last1 - first1 且 N2 = last2 - first2 。 可能的实现
示例
另见
|