operator==,!=,<,<=,>,>=(std::experimental::filesystem::path)
来自cppreference.com
| |
(1) | (文件系统 TS) |
| |
(2) | (文件系统 TS) |
| |
(3) | (文件系统 TS) |
| |
(4) | (文件系统 TS) |
| |
(5) | (文件系统 TS) |
| |
(6) | (文件系统 TS) |
按字典序比较两个路径。
1) 检查
lhs 和 rhs 是否相等。等价于 !(lhs < rhs) && !(rhs < lhs)。2) 检查
lhs 和 rhs 是否不相等。等价于 !(lhs == rhs)。3) 检查
lhs 是否小于 rhs。等价于 lhs.compare(rhs) < 0。4) 检查
lhs 是否小于或等于 rhs。等价于 !(rhs < lhs)。5) 检查
lhs 是否大于 rhs。等价于 rhs < lhs。6) 检查
lhs 是否大于或等于 rhs。等价于 !(lhs < rhs)。参数
| lhs, rhs | - | 要比较的路径 |
返回值
如果对应比较成立则为 true,否则为 false。
异常
noexcept 规定:
noexcept注解
路径相等性和等价性具有不同的语义。
在相等性的情况中,如 operator== 所确定,仅比较词法表示。因此,path("a") == path("b") 永不为 true。
在等价性的情况中,如 equivalent() 所确定,它检测两个路径是否解析为相同的文件系统对象。因而当两个路径解析为相同文件时 equivalent("a", "b") 将返回 true。
参阅
| 按字典序比较两个路径的词法表示 (公开成员函数) |