From Jason Turner

[stringbuf.assign]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpi_cyunt3/{from.md → to.md} +12 -4
tmp/tmpi_cyunt3/{from.md → to.md} RENAMED
@@ -1,6 +1,6 @@
1
- #### Assign and swap <a id="stringbuf.assign">[[stringbuf.assign]]</a>
2
 
3
  ``` cpp
4
  basic_stringbuf& operator=(basic_stringbuf&& rhs);
5
  ```
6
 
@@ -9,18 +9,26 @@ would have had if it had been move constructed from `rhs`
9
  (see  [[stringbuf.cons]]).
10
 
11
  *Returns:* `*this`.
12
 
13
  ``` cpp
14
- void swap(basic_stringbuf& rhs);
15
  ```
16
 
 
 
 
 
17
  *Effects:* Exchanges the state of `*this` and `rhs`.
18
 
 
 
 
 
19
  ``` cpp
20
  template<class charT, class traits, class Allocator>
21
  void swap(basic_stringbuf<charT, traits, Allocator>& x,
22
- basic_stringbuf<charT, traits, Allocator>& y);
23
  ```
24
 
25
- *Effects:* As if by `x.swap(y)`.
26
 
 
1
+ #### Assignment and swap <a id="stringbuf.assign">[[stringbuf.assign]]</a>
2
 
3
  ``` cpp
4
  basic_stringbuf& operator=(basic_stringbuf&& rhs);
5
  ```
6
 
 
9
  (see  [[stringbuf.cons]]).
10
 
11
  *Returns:* `*this`.
12
 
13
  ``` cpp
14
+ void swap(basic_stringbuf& rhs) noexcept(see below);
15
  ```
16
 
17
+ *Preconditions:*
18
+ `allocator_traits<Allocator>::propagate_on_container_swap::value` is
19
+ `true` or `get_allocator() == s.get_allocator()` is `true`.
20
+
21
  *Effects:* Exchanges the state of `*this` and `rhs`.
22
 
23
+ *Remarks:* The expression inside `noexcept` is equivalent to:
24
+ `allocator_traits<Allocator>::propagate_on_container_swap::value ||`
25
+ `allocator_traits<Allocator>::is_always_equal::value`.
26
+
27
  ``` cpp
28
  template<class charT, class traits, class Allocator>
29
  void swap(basic_stringbuf<charT, traits, Allocator>& x,
30
+ basic_stringbuf<charT, traits, Allocator>& y) noexcept(noexcept(x.swap(y)));
31
  ```
32
 
33
+ *Effects:* Equivalent to: `x.swap(y)`.
34