From Jason Turner

[fs.path.compare]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpyigxk7k0/{from.md → to.md} +18 -19
tmp/tmpyigxk7k0/{from.md → to.md} RENAMED
@@ -1,32 +1,31 @@
1
- ##### `path` compare <a id="fs.path.compare">[[fs.path.compare]]</a>
2
 
3
  ``` cpp
4
  int compare(const path& p) const noexcept;
5
  ```
6
 
7
  *Returns:*
8
 
9
- - A value less than `0`, if `native()` for the elements of `*this` are
10
- lexicographically less than `native()` for the elements of `p`;
11
- otherwise,
12
- - a value greater than `0`, if `native()` for the elements of `*this`
13
- are lexicographically greater than `native()` for the elements of `p`;
14
- otherwise,
15
- - `0`.
16
-
17
- *Remarks:* The elements are determined as if by iteration over the
18
- half-open range \[`begin()`, `end()`) for `*this` and `p`.
 
 
 
 
19
 
20
  ``` cpp
21
- int compare(const string_type& s) const
22
  int compare(basic_string_view<value_type> s) const;
 
23
  ```
24
 
25
- *Returns:* `compare(path(s))`.
26
-
27
- ``` cpp
28
- int compare(const value_type* s) const
29
- ```
30
-
31
- *Returns:* `compare(path(s))`.
32
 
 
1
+ ##### Compare <a id="fs.path.compare">[[fs.path.compare]]</a>
2
 
3
  ``` cpp
4
  int compare(const path& p) const noexcept;
5
  ```
6
 
7
  *Returns:*
8
 
9
+ - Let `rootNameComparison` be the result of
10
+ `this->root_name().native().compare(p.root_name().native())`. If
11
+ `rootNameComparison` is not `0`, `rootNameComparison`.
12
+ - Otherwise, if `!this->has_root_directory()` and
13
+ `p.has_root_directory()`, a value less than `0`.
14
+ - Otherwise, if `this->has_root_directory()` and
15
+ `!p.has_root_directory()`, a value greater than `0`.
16
+ - Otherwise, if `native()` for the elements of `this->relative_path()`
17
+ are lexicographically less than `native()` for the elements of
18
+ `p.relative_path()`, a value less than `0`.
19
+ - Otherwise, if `native()` for the elements of `this->relative_path()`
20
+ are lexicographically greater than `native()` for the elements of
21
+ `p.relative_path()`, a value greater than `0`.
22
+ - Otherwise, `0`.
23
 
24
  ``` cpp
25
+ int compare(const string_type& s) const;
26
  int compare(basic_string_view<value_type> s) const;
27
+ int compare(const value_type* s) const;
28
  ```
29
 
30
+ *Effects:* Equivalent to: `return compare(path(s));`
 
 
 
 
 
 
31