Namespaces
Variants

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

From cppreference.net
bool operator == ( const path & lhs, const path & rhs ) ;
(1) (文件系统 TS)
bool operator ! = ( const path & lhs, const path & rhs ) ;
(2) (文件系统 TS)
bool operator < ( const path & lhs, const path & rhs ) ;
(3) (文件系统 TS)
bool operator <= ( const path & lhs, const path & rhs ) ;
(4) (文件系统 TS)
bool operator > ( const path & lhs, const path & rhs ) ;
(5) (文件系统 TS)
bool operator >= ( const path & lhs, const path & rhs ) ;
(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

参见

按字典序比较两个路径的词汇表示
(公开成员函数)