From Jason Turner

[unique.ptr.single.asgn]

Diff to HTML by rtfpessoa

tmp/tmptnp3jmfw/{from.md → to.md} RENAMED
@@ -3,11 +3,11 @@
3
  ``` cpp
4
  unique_ptr& operator=(unique_ptr&& u) noexcept;
5
  ```
6
 
7
  *Requires:* If `D` is not a reference type, `D` shall satisfy the
8
- requirements of `MoveAssignable` (Table  [[moveassignable]]) and
9
  assignment of the deleter from an rvalue of type `D` shall not throw an
10
  exception. Otherwise, `D` is a reference type; `remove_reference_t<D>`
11
  shall satisfy the `CopyAssignable` requirements and assignment of the
12
  deleter from an lvalue of type `D` shall not throw an exception.
13
 
@@ -28,12 +28,14 @@ deleter from an lvalue of type `E` shall be well-formed and shall not
28
  throw an exception.
29
 
30
  *Remarks:* This operator shall not participate in overload resolution
31
  unless:
32
 
33
- - `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer` and
34
- - `U` is not an array type.
 
 
35
 
36
  *Effects:* Transfers ownership from `u` to `*this` as if by calling
37
  `reset(u.release())` followed by
38
  `get_deleter() = std::forward<E>(u.get_deleter())`.
39
 
@@ -41,11 +43,11 @@ unless:
41
 
42
  ``` cpp
43
  unique_ptr& operator=(nullptr_t) noexcept;
44
  ```
45
 
46
- *Effects:* `reset()`.
47
 
48
- `get() == nullptr`
49
 
50
  *Returns:* `*this`.
51
 
 
3
  ``` cpp
4
  unique_ptr& operator=(unique_ptr&& u) noexcept;
5
  ```
6
 
7
  *Requires:* If `D` is not a reference type, `D` shall satisfy the
8
+ requirements of `MoveAssignable` (Table  [[tab:moveassignable]]) and
9
  assignment of the deleter from an rvalue of type `D` shall not throw an
10
  exception. Otherwise, `D` is a reference type; `remove_reference_t<D>`
11
  shall satisfy the `CopyAssignable` requirements and assignment of the
12
  deleter from an lvalue of type `D` shall not throw an exception.
13
 
 
28
  throw an exception.
29
 
30
  *Remarks:* This operator shall not participate in overload resolution
31
  unless:
32
 
33
+ - `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer`,
34
+ and
35
+ - `U` is not an array type, and
36
+ - `is_assignable_v<D&, E&&>` is `true`.
37
 
38
  *Effects:* Transfers ownership from `u` to `*this` as if by calling
39
  `reset(u.release())` followed by
40
  `get_deleter() = std::forward<E>(u.get_deleter())`.
41
 
 
43
 
44
  ``` cpp
45
  unique_ptr& operator=(nullptr_t) noexcept;
46
  ```
47
 
48
+ *Effects:* As if by `reset()`.
49
 
50
+ *Postconditions:* `get() == nullptr`.
51
 
52
  *Returns:* `*this`.
53