tmp/tmp7soljjyu/{from.md → to.md}
RENAMED
|
@@ -1,16 +1,19 @@
|
|
| 1 |
##### `basic_string::swap` <a id="string.swap">[[string.swap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
-
void swap(basic_string& s)
|
| 5 |
noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
|
| 6 |
allocator_traits<Allocator>::is_always_equal::value);
|
| 7 |
```
|
| 8 |
|
| 9 |
-
*
|
| 10 |
-
|
| 11 |
-
`
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
*Throws:* Nothing.
|
| 14 |
|
| 15 |
*Complexity:* Constant time.
|
| 16 |
|
|
|
|
| 1 |
##### `basic_string::swap` <a id="string.swap">[[string.swap]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
+
constexpr void swap(basic_string& s)
|
| 5 |
noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
|
| 6 |
allocator_traits<Allocator>::is_always_equal::value);
|
| 7 |
```
|
| 8 |
|
| 9 |
+
*Preconditions:*
|
| 10 |
+
`allocator_traits<Allocator>::propagate_on_container_swap::value` is
|
| 11 |
+
`true` or `get_allocator() == s.get_allocator()`.
|
| 12 |
+
|
| 13 |
+
*Ensures:* `*this` contains the same sequence of characters that was in
|
| 14 |
+
`s`, `s` contains the same sequence of characters that was in `*this`.
|
| 15 |
|
| 16 |
*Throws:* Nothing.
|
| 17 |
|
| 18 |
*Complexity:* Constant time.
|
| 19 |
|