From Jason Turner

[unique.ptr.dltr.dflt1]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmppchywin3/{from.md → to.md} +17 -5
tmp/tmppchywin3/{from.md → to.md} RENAMED
@@ -2,19 +2,31 @@
2
 
3
  ``` cpp
4
  namespace std {
5
  template <class T> struct default_delete<T[]> {
6
  constexpr default_delete() noexcept = default;
7
- void operator()(T*) const;
8
- template <class U> void operator()(U*) const = delete;
9
  };
10
  }
11
  ```
12
 
13
  ``` cpp
14
- void operator()(T* ptr) const;
15
  ```
16
 
17
- *Effects:* calls `delete[]` on `ptr`.
 
18
 
19
- *Remarks:* If T is an incomplete type, the program is ill-formed.
 
 
 
 
 
 
 
 
 
 
 
20
 
 
2
 
3
  ``` cpp
4
  namespace std {
5
  template <class T> struct default_delete<T[]> {
6
  constexpr default_delete() noexcept = default;
7
+ template <class U> default_delete(const default_delete<U[]>&) noexcept;
8
+ template <class U> void operator()(U* ptr) const;
9
  };
10
  }
11
  ```
12
 
13
  ``` cpp
14
+ template <class U> default_delete(const default_delete<U[]>& other) noexcept;
15
  ```
16
 
17
+ *Effects:* constructs a `default_delete` object from another
18
+ `default_delete<U[]>` object.
19
 
20
+ *Remarks:* This constructor shall not participate in overload resolution
21
+ unless `U(*)[]` is convertible to `T(*)[]`.
22
+
23
+ ``` cpp
24
+ template <class U> void operator()(U* ptr) const;
25
+ ```
26
+
27
+ *Effects:* Calls `delete[]` on `ptr`.
28
+
29
+ *Remarks:* If `U` is an incomplete type, the program is ill-formed. This
30
+ function shall not participate in overload resolution unless `U(*)[]` is
31
+ convertible to `T(*)[]`.
32