tmp/tmpxprwcdew/{from.md → to.md}
RENAMED
|
@@ -1,22 +1,23 @@
|
|
| 1 |
##### `shared_ptr` comparison <a id="util.smartptr.shared.cmp">[[util.smartptr.shared.cmp]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
template<class T, class U>
|
|
|
|
| 5 |
```
|
| 6 |
|
| 7 |
*Returns:* `a.get() == b.get()`.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
-
template<class T, class U>
|
|
|
|
| 11 |
```
|
| 12 |
|
| 13 |
-
*Returns:* `less<
|
| 14 |
-
pointer type (Clause [[expr]]) of `T*` and `U*`.
|
| 15 |
|
| 16 |
-
Defining a comparison
|
| 17 |
-
keys in associative containers.
|
| 18 |
|
| 19 |
``` cpp
|
| 20 |
template <class T>
|
| 21 |
bool operator==(const shared_ptr<T>& a, nullptr_t) noexcept;
|
| 22 |
template <class T>
|
|
@@ -40,12 +41,13 @@ template <class T>
|
|
| 40 |
template <class T>
|
| 41 |
bool operator<(nullptr_t, const shared_ptr<T>& a) noexcept;
|
| 42 |
```
|
| 43 |
|
| 44 |
*Returns:* The first function template returns
|
| 45 |
-
`less<T*>()(a.get(), nullptr)`. The second
|
| 46 |
-
|
|
|
|
| 47 |
|
| 48 |
``` cpp
|
| 49 |
template <class T>
|
| 50 |
bool operator>(const shared_ptr<T>& a, nullptr_t) noexcept;
|
| 51 |
template <class T>
|
|
|
|
| 1 |
##### `shared_ptr` 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, 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>
|
|
|
|
| 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>
|