tmp/tmp8timecwf/{from.md → to.md}
RENAMED
|
@@ -1,79 +1,33 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class T, class U>
|
| 5 |
bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept;
|
| 6 |
```
|
| 7 |
|
| 8 |
*Returns:* `a.get() == b.get()`.
|
| 9 |
|
| 10 |
-
``` cpp
|
| 11 |
-
template<class T, class U>
|
| 12 |
-
bool operator<(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept;
|
| 13 |
-
```
|
| 14 |
-
|
| 15 |
-
*Returns:* `less<>()(a.get(), b.get())`.
|
| 16 |
-
|
| 17 |
-
[*Note 9*: Defining a comparison function allows `shared_ptr` objects
|
| 18 |
-
to be used as keys in associative containers. — *end note*]
|
| 19 |
-
|
| 20 |
``` cpp
|
| 21 |
template<class T>
|
| 22 |
bool operator==(const shared_ptr<T>& a, nullptr_t) noexcept;
|
| 23 |
-
template <class T>
|
| 24 |
-
bool operator==(nullptr_t, const shared_ptr<T>& a) noexcept;
|
| 25 |
```
|
| 26 |
|
| 27 |
*Returns:* `!a`.
|
| 28 |
|
| 29 |
``` cpp
|
| 30 |
-
template
|
| 31 |
-
|
| 32 |
-
template <class T>
|
| 33 |
-
bool operator!=(nullptr_t, const shared_ptr<T>& a) noexcept;
|
| 34 |
-
```
|
| 35 |
-
|
| 36 |
-
*Returns:* `(bool)a`.
|
| 37 |
-
|
| 38 |
-
``` cpp
|
| 39 |
-
template <class T>
|
| 40 |
-
bool operator<(const shared_ptr<T>& a, nullptr_t) noexcept;
|
| 41 |
-
template <class T>
|
| 42 |
-
bool operator<(nullptr_t, const shared_ptr<T>& a) noexcept;
|
| 43 |
-
```
|
| 44 |
-
|
| 45 |
-
*Returns:* The first function template returns
|
| 46 |
-
`less<shared_ptr<T>::element_type*>()(a.get(), nullptr)`. The second
|
| 47 |
-
function template returns
|
| 48 |
-
`less<shared_ptr<T>::element_type*>()(nullptr, a.get())`.
|
| 49 |
-
|
| 50 |
-
``` cpp
|
| 51 |
-
template <class T>
|
| 52 |
-
bool operator>(const shared_ptr<T>& a, nullptr_t) noexcept;
|
| 53 |
-
template <class T>
|
| 54 |
-
bool operator>(nullptr_t, const shared_ptr<T>& a) noexcept;
|
| 55 |
```
|
| 56 |
|
| 57 |
-
*Returns:*
|
| 58 |
-
function template returns `a < nullptr`.
|
| 59 |
-
|
| 60 |
-
``` cpp
|
| 61 |
-
template <class T>
|
| 62 |
-
bool operator<=(const shared_ptr<T>& a, nullptr_t) noexcept;
|
| 63 |
-
template <class T>
|
| 64 |
-
bool operator<=(nullptr_t, const shared_ptr<T>& a) noexcept;
|
| 65 |
-
```
|
| 66 |
|
| 67 |
-
*
|
| 68 |
-
|
| 69 |
|
| 70 |
``` cpp
|
| 71 |
template<class T>
|
| 72 |
-
|
| 73 |
-
template <class T>
|
| 74 |
-
bool operator>=(nullptr_t, const shared_ptr<T>& a) noexcept;
|
| 75 |
```
|
| 76 |
|
| 77 |
-
*Returns:*
|
| 78 |
-
second function template returns `!(nullptr < a)`.
|
| 79 |
|
|
|
|
| 1 |
+
#### Comparison <a id="util.smartptr.shared.cmp">[[util.smartptr.shared.cmp]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class T, class U>
|
| 5 |
bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept;
|
| 6 |
```
|
| 7 |
|
| 8 |
*Returns:* `a.get() == b.get()`.
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
``` cpp
|
| 11 |
template<class T>
|
| 12 |
bool operator==(const shared_ptr<T>& a, nullptr_t) noexcept;
|
|
|
|
|
|
|
| 13 |
```
|
| 14 |
|
| 15 |
*Returns:* `!a`.
|
| 16 |
|
| 17 |
``` cpp
|
| 18 |
+
template<class T, class U>
|
| 19 |
+
strong_ordering operator<=>(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
```
|
| 21 |
|
| 22 |
+
*Returns:* `compare_three_way()(a.get(), b.get())`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
+
[*Note 1*: Defining a comparison function allows `shared_ptr` objects
|
| 25 |
+
to be used as keys in associative containers. — *end note*]
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
template<class T>
|
| 29 |
+
strong_ordering operator<=>(const shared_ptr<T>& a, nullptr_t) noexcept;
|
|
|
|
|
|
|
| 30 |
```
|
| 31 |
|
| 32 |
+
*Returns:* `compare_three_way()(a.get(), nullptr)`.
|
|
|
|
| 33 |
|