命名空间
变体
操作

operator==,!=,<,<=,>,>=(std::experimental::filesystem::path)

来自 cppreference.cn
< cpp‎ | experimental‎ | fs‎ | path
 
 
实验性
技术规范
文件系统库 (filesystem TS)
库基础 (library fundamentals TS)
库基础 2 (library fundamentals TS v2)
库基础 3 (library fundamentals TS v3)
并行扩展 (parallelism TS)
并行扩展 2 (parallelism TS v2)
并发扩展 (concurrency TS)
并发扩展 2 (concurrency TS v2)
概念 (concepts TS)
范围 (ranges TS)
反射 (reflection TS)
数学特殊函数 (special functions TR)
实验性非 TS
模式匹配
线性代数
std::execution
契约
2D 图形
 
 
 
bool operator==( const path& lhs, const path& rhs );
(1) (filesystem TS)
bool operator!=( const path& lhs, const path& rhs );
(2) (filesystem TS)
bool operator<( const path& lhs, const path& rhs );
(3) (filesystem TS)
bool operator<=( const path& lhs, const path& rhs );
(4) (filesystem TS)
bool operator>( const path& lhs, const path& rhs );
(5) (filesystem TS)
bool operator>=( const path& lhs, const path& rhs );
(6) (filesystem TS)

字典序比较两个路径。

1) 检查 lhsrhs 是否相等。等价于 !(lhs < rhs) && !(rhs < lhs)
2) 检查 lhsrhs 是否不相等。等价于 !(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

[编辑] 另请参阅

字典序比较两个路径的词法表示
(公共成员函数) [编辑]