operators (std::filesystem::path)
bool operator==( const path& lhs, const path& rhs ); | (1) | (since C++17) |
|---|---|---|
bool operator!=( const path& lhs, const path& rhs ); | (2) | (since C++17) |
bool operator<( const path& lhs, const path& rhs ); | (3) | (since C++17) |
bool operator<=( const path& lhs, const path& rhs ); | (4) | (since C++17) |
bool operator>( const path& lhs, const path& rhs ); | (5) | (since C++17) |
bool operator>=( const path& lhs, const path& rhs ); | (6) | (since C++17) |
按字典顺序比较两条路径。
1%29检查是否lhs和rhs是平等的。相当于!(lhs < rhs) && !(rhs < lhs)...
2%29检查是否lhs和rhs不平等。相当于!(lhs == rhs)...
3%29检查是否lhs小于rhs相当于lhs.compare(rhs) < 0...
4%29检查是否lhs小于或等于rhs相当于!(rhs < lhs)...
5%29检查是否lhs大于rhs相当于rhs < lhs...
6%29检查是否lhs大于或等于rhs相当于!(lhs < rhs)...
参数
lhs, rhs | - | the paths to compare |
|---|
返回值
true如果相应的比较产生,false否则。
例外
noexcept规格:
noexcept
注记
路径相等和等价具有不同的语义。
在平等的情况下,由operator==,只对词法表示进行比较。因此,path("a") == path("b")永远不会true...
在对等的情况下,由equivalent(),则检查是否有两条路径。决断到同一个文件系统对象。因此equivalent("a", "b")会回来true如果路径解析到同一个文件。
另见
compare | compares the lexical representations of two paths lexicographically (public member function) |
|---|
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

