From Jason Turner

[unique.ptr.single]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpu9hak1_p/{from.md → to.md} +13 -16
tmp/tmpu9hak1_p/{from.md → to.md} RENAMED
@@ -28,11 +28,11 @@ namespace std {
28
  unique_ptr& operator=(unique_ptr&& u) noexcept;
29
  template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
30
  unique_ptr& operator=(nullptr_t) noexcept;
31
 
32
  // [unique.ptr.single.observers], observers
33
- typename add_lvalue_reference<T>::type operator*() const;
34
  pointer operator->() const noexcept;
35
  pointer get() const noexcept;
36
  deleter_type& get_deleter() noexcept;
37
  const deleter_type& get_deleter() const noexcept;
38
  explicit operator bool() const noexcept;
@@ -58,16 +58,14 @@ is valid and has the effect of disposing of the pointer as appropriate
58
  for that deleter.
59
 
60
  If the deleter’s type `D` is not a reference type, `D` shall satisfy the
61
  requirements of `Destructible` (Table  [[destructible]]).
62
 
63
- If the type `remove_reference<D>::type::pointer` exists, then
64
- `unique_ptr<T,
65
- D>::pointer` shall be a synonym for
66
- `remove_reference<D>::type::pointer`. Otherwise
67
- `unique_ptr<T, D>::pointer` shall be a synonym for `T*`. The type
68
- `unique_ptr<T,
69
  D>::pointer` shall satisfy the requirements of `NullablePointer` (
70
  [[nullablepointer.requirements]]).
71
 
72
  Given an allocator type `X` ([[allocator.requirements]]) and letting
73
  `A` be a synonym for `allocator_traits<X>`, the types `A::pointer`,
@@ -263,18 +261,17 @@ unique_ptr& operator=(unique_ptr&& u) noexcept;
263
  ```
264
 
265
  *Requires:* If `D` is not a reference type, `D` shall satisfy the
266
  requirements of `MoveAssignable` (Table  [[moveassignable]]) and
267
  assignment of the deleter from an rvalue of type `D` shall not throw an
268
- exception. Otherwise, `D` is a reference type;
269
- `remove_reference<D>::type` shall satisfy the `CopyAssignable`
270
- requirements and assignment of the deleter from an lvalue of type `D`
271
- shall not throw an exception.
272
 
273
  *Effects:* Transfers ownership from `u` to `*this` as if by calling
274
- `reset(u.release())` followed by an assignment from
275
- `std::forward<D>(u.get_deleter())`.
276
 
277
  *Returns:* `*this`.
278
 
279
  ``` cpp
280
  template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
@@ -291,12 +288,12 @@ unless:
291
 
292
  - `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer` and
293
  - `U` is not an array type.
294
 
295
  *Effects:* Transfers ownership from `u` to `*this` as if by calling
296
- `reset(u.release())` followed by an assignment from
297
- `std::forward<D>(u.get_deleter())`.
298
 
299
  *Returns:* `*this`.
300
 
301
  ``` cpp
302
  unique_ptr& operator=(nullptr_t) noexcept;
@@ -309,11 +306,11 @@ unique_ptr& operator=(nullptr_t) noexcept;
309
  *Returns:* `*this`.
310
 
311
  ##### `unique_ptr` observers <a id="unique.ptr.single.observers">[[unique.ptr.single.observers]]</a>
312
 
313
  ``` cpp
314
- typename add_lvalue_reference<T>::type operator*() const;
315
  ```
316
 
317
  *Requires:* `get() != nullptr`.
318
 
319
  *Returns:* `*get()`.
 
28
  unique_ptr& operator=(unique_ptr&& u) noexcept;
29
  template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
30
  unique_ptr& operator=(nullptr_t) noexcept;
31
 
32
  // [unique.ptr.single.observers], observers
33
+ add_lvalue_reference_t<T> operator*() const;
34
  pointer operator->() const noexcept;
35
  pointer get() const noexcept;
36
  deleter_type& get_deleter() noexcept;
37
  const deleter_type& get_deleter() const noexcept;
38
  explicit operator bool() const noexcept;
 
58
  for that deleter.
59
 
60
  If the deleter’s type `D` is not a reference type, `D` shall satisfy the
61
  requirements of `Destructible` (Table  [[destructible]]).
62
 
63
+ If the type `remove_reference_t<D>::pointer` exists, then `unique_ptr<T,
64
+ D>::pointer` shall be a synonym for `remove_reference_t<D>::pointer`.
65
+ Otherwise `unique_ptr<T, D>::pointer` shall be a synonym for `T*`. The
66
+ type `unique_ptr<T,
 
 
67
  D>::pointer` shall satisfy the requirements of `NullablePointer` (
68
  [[nullablepointer.requirements]]).
69
 
70
  Given an allocator type `X` ([[allocator.requirements]]) and letting
71
  `A` be a synonym for `allocator_traits<X>`, the types `A::pointer`,
 
261
  ```
262
 
263
  *Requires:* If `D` is not a reference type, `D` shall satisfy the
264
  requirements of `MoveAssignable` (Table  [[moveassignable]]) and
265
  assignment of the deleter from an rvalue of type `D` shall not throw an
266
+ exception. Otherwise, `D` is a reference type; `remove_reference_t<D>`
267
+ shall satisfy the `CopyAssignable` requirements and assignment of the
268
+ deleter from an lvalue of type `D` shall not throw an exception.
 
269
 
270
  *Effects:* Transfers ownership from `u` to `*this` as if by calling
271
+ `reset(u.release())` followed by
272
+ `get_deleter() = std::forward<D>(u.get_deleter())`.
273
 
274
  *Returns:* `*this`.
275
 
276
  ``` cpp
277
  template <class U, class E> unique_ptr& operator=(unique_ptr<U, E>&& u) noexcept;
 
288
 
289
  - `unique_ptr<U, E>::pointer` is implicitly convertible to `pointer` and
290
  - `U` is not an array type.
291
 
292
  *Effects:* Transfers ownership from `u` to `*this` as if by calling
293
+ `reset(u.release())` followed by
294
+ `get_deleter() = std::forward<E>(u.get_deleter())`.
295
 
296
  *Returns:* `*this`.
297
 
298
  ``` cpp
299
  unique_ptr& operator=(nullptr_t) noexcept;
 
306
  *Returns:* `*this`.
307
 
308
  ##### `unique_ptr` observers <a id="unique.ptr.single.observers">[[unique.ptr.single.observers]]</a>
309
 
310
  ``` cpp
311
+ add_lvalue_reference_t<T> operator*() const;
312
  ```
313
 
314
  *Requires:* `get() != nullptr`.
315
 
316
  *Returns:* `*get()`.