From Jason Turner

[unique.ptr.single.modifiers]

Diff to HTML by rtfpessoa

tmp/tmpvzpqfy9t/{from.md → to.md} RENAMED
@@ -1,41 +1,40 @@
1
- ##### `unique_ptr` modifiers <a id="unique.ptr.single.modifiers">[[unique.ptr.single.modifiers]]</a>
2
 
3
  ``` cpp
4
  pointer release() noexcept;
5
  ```
6
 
7
- *Postconditions:* `get() == nullptr`.
8
 
9
  *Returns:* The value `get()` had at the start of the call to `release`.
10
 
11
  ``` cpp
12
  void reset(pointer p = pointer()) noexcept;
13
  ```
14
 
15
- *Requires:* The expression `get_deleter()(get())` shall be well formed,
16
- shall have well-defined behavior, and shall not throw exceptions.
17
 
18
  *Effects:* Assigns `p` to the stored pointer, and then if and only if
19
  the old value of the stored pointer, `old_p`, was not equal to
20
  `nullptr`, calls `get_deleter()(old_p)`.
21
 
22
  [*Note 5*: The order of these operations is significant because the
23
  call to `get_deleter()` may destroy `*this`. — *end note*]
24
 
25
- *Postconditions:* `get() == p`.
26
 
27
  [*Note 6*: The postcondition does not hold if the call to
28
  `get_deleter()` destroys `*this` since `this->get()` is no longer a
29
  valid expression. — *end note*]
30
 
31
  ``` cpp
32
  void swap(unique_ptr& u) noexcept;
33
  ```
34
 
35
- *Requires:* `get_deleter()` shall be
36
- swappable ([[swappable.requirements]]) and shall not throw an exception
37
- under `swap`.
38
 
39
  *Effects:* Invokes `swap` on the stored pointers and on the stored
40
  deleters of `*this` and `u`.
41
 
 
1
+ ##### Modifiers <a id="unique.ptr.single.modifiers">[[unique.ptr.single.modifiers]]</a>
2
 
3
  ``` cpp
4
  pointer release() noexcept;
5
  ```
6
 
7
+ *Ensures:* `get() == nullptr`.
8
 
9
  *Returns:* The value `get()` had at the start of the call to `release`.
10
 
11
  ``` cpp
12
  void reset(pointer p = pointer()) noexcept;
13
  ```
14
 
15
+ *Preconditions:* The expression `get_deleter()(get())` is well-formed,
16
+ has well-defined behavior, and does not throw exceptions.
17
 
18
  *Effects:* Assigns `p` to the stored pointer, and then if and only if
19
  the old value of the stored pointer, `old_p`, was not equal to
20
  `nullptr`, calls `get_deleter()(old_p)`.
21
 
22
  [*Note 5*: The order of these operations is significant because the
23
  call to `get_deleter()` may destroy `*this`. — *end note*]
24
 
25
+ *Ensures:* `get() == p`.
26
 
27
  [*Note 6*: The postcondition does not hold if the call to
28
  `get_deleter()` destroys `*this` since `this->get()` is no longer a
29
  valid expression. — *end note*]
30
 
31
  ``` cpp
32
  void swap(unique_ptr& u) noexcept;
33
  ```
34
 
35
+ *Preconditions:* `get_deleter()` is swappable [[swappable.requirements]]
36
+ and does not throw an exception under `swap`.
 
37
 
38
  *Effects:* Invokes `swap` on the stored pointers and on the stored
39
  deleters of `*this` and `u`.
40